let P3_yellow = new Color("p3", [1, 1, 0]);
let P3_LCH = P3_yellow.lch;
let sRGB_yellow = P3_yellow.to("srgb");
sRGB_yellow.toGamut();
sRGB_yellow.toGamut({method: "clip"});
sRGB_yellow.toGamut({method: "jzczhz.chroma"});
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Test inherited value of currentColor is the keyword currentColor | |
"This happens at used-value time, which means that if the value is inherited, it’s | |
inherited as currentcolor, not as the value of the color property, so descendants | |
will use their own color property to resolve it." | |
*/ | |
.outer {color: red; | |
background-color: currentColor; | |
font-size: 200%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* use with eyes | |
*/ | |
.robot { | |
fill: none; | |
stroke: red; |
let color1 = new Color("rgb(76% 62% 03% / 0.4)");
let start1 = color1.to("lab");
let pm1 = start1.coords.map(c => c * color1.alpha);
let color2 = new Color("color(display-p3 0.84 0.19 0.72 / 0.6)");
let start2 = color2.to("lab");
let pm2 = start2.coords.map(c => c * color2.alpha);
OlderNewer