Color Manipulation
#495dc5
100
200
300
400
500
600
700
800
100
200
300
400
500
600
700
800
200
500
800
.valid-css-color-function-colors {
--srgb: color(srgb 1 1 1);
--srgb-linear: color(srgb-linear 100% 100% 100% / 50%);
--display-p3: color(display-p3 1 1 1);
--rec2020: color(rec2020 0 0 0);
--a98-rgb: color(a98-rgb 1 1 1 / 25%);
--prophoto: color(prophoto-rgb 0% 0% 0%);
--xyz: color(xyz 1 1 1);
}.most-hyped {
--display-p3: color(display-p3 1 1 1);
--rec2020: color(rec2020 0 0 0);
}.element {
background: oklch(80% 50% 220);
}lightness
chroma
hue
Næsten ligesom hsl()
color-mix() og RCS
Blanding af farver
hover- og active-state
button {
background: #FFCC4A;
&:hover {
background: oklch( from #FFCC4A calc(l - .05) c h );
}
&:active {
background: oklch( from #FFCC4A calc(l - .1) c h );
}
}Brug oklch(from ... l c h)
Ret til i denne kanal