Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Web colors
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== CSS Color 4 === Level 4 of the CSS Color specification introduced several new CSS color formats.<ref name=CSSC4>{{cite web|url=https://www.w3.org/TR/css-color-4/ |title=CSS Color Module Level 4 |publisher=W3C |date= |accessdate=2022-03-14}}</ref> Besides new ways to write colors, it also introduces the concept of mixing colors in a non-[[sRGB]] color space, a first step towards fixing [[Color gradient#Effect of color space|a well-known issue in color gradients]]. Some sections explaining color theory and common operations like [[gamut mapping]] are also added to aid implementation.<ref name=CSSC4/> <syntaxhighlight lang="CSS"> p { color: #F80A } /* #rgba */ p { color: #FF8800AA } /* #rrggbbaa */ p { color: rgb(255.0 136.0 0.0 / 0.667) } /* float range 0.0 - 255.0 for higher than 8-bit precision */ p { color: rgb(100% 53.3% 0% / 66.7%) } /* float range 0.0% - 100.0% */ p { color: color(sRGB 1 0.533 0 / 0.667) } /* color() function with color space */ </syntaxhighlight> ==== Device independent color ==== CSS Color 4 introduces several different formats for [[Color management|device independent color]] that can display the entirety of visible color (in a capable screen), including:<ref name="autogenerated1">{{cite web|title=CSS Color Module Level 4: Overview|url=https://www.w3.org/TR/css-color-4/Overview.html|access-date=2022-01-11|website=W3C }}</ref> * [[CIELAB color space|CIE Lab and LCH]] * [[OKLab|OKLab and OKLCH]] (preferred over Lab/LCH)<ref name=CSSC4/>{{rp|at=Β§Β§9.2β3}} * [[CIE 1931 color space|XYZ]] (D50 or D65 [default]) ==== Predefined color spaces ==== A number of [[RGB color model|RGB]] spaces with [[gamut]]s that are wider than [[sRGB]] are also introduced through the new <code>color()</code> function:<ref name="autogenerated1"/> * [[DCI-P3|Display P3]] * [[ProPhoto RGB color space|Prophoto]] * [[Rec. 2020|REC.2020]] * [[Adobe RGB color space|Adobe 1998 RGB]] A linearized variant of sRGB is also defined for color mixing.<ref name=CSSC4/> ==== Other formats ==== {{anchor|rebeccapurple}}On 21 June 2014, the [[CSS WG]] added the color RebeccaPurple to the Editor's Draft of the Colors module level 4, to commemorate [[Eric A. Meyer|Eric Meyer]]'s daughter Rebecca, who died on 7 June 2014, her sixth birthday.<ref>{{cite web |url=//lists.w3.org/Archives/Public/www-style/2014Jun/0312.html |publisher=W3C |work=Post to www-style mailing list|title=Re: [CfC] adding 'rebeccapurple' to CSS Color Level 4|date=21 June 2014|author1-first=Daniel|author1-last=Glazman|access-date=24 June 2014 }}</ref> <div style="margin-left:3%; margin-right:3%;"> {{Colort|caption=Color added in CSS4 Colors module}} {{Colort/Color|name=RebeccaPurple|r=102|g=51|b=153}} |}</div> CSS4 also introduces the [[HWB color model]] as an alternative to HSL/HSV.<ref name="css4"/>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)