Skip to content

Commit ed85165

Browse files
author
Chris Lilley
committed
[css-color-5] Improve the fake-greyscaling calc example, fix w3c#6857
1 parent c85ae5f commit ed85165

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

css-color-5/Overview.bs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,12 +941,22 @@ so it has meaningful values for the channels.
941941

942942
Using this,
943943
''red'' would become ''rgb(30% 30% 30%)'',
944-
''green'' would become ''rgb(59% 59% 59%)'',
944+
''lime'' would become ''rgb(59% 59% 59%)'',
945945
and ''blue'' would become ''rgb(11% 11% 11%)''.
946946
A more moderate color, like ''darkolivegreen'',
947947
which has RGB values ''rgb(85 107 47)'',
948948
would become approximately ''rgb(37% 37% 37%)''.
949949

950+
(Rough because firstly,
951+
although this looks like a luminance calculation,
952+
the red green and blue values
953+
are manipulated in gamma-encoded space
954+
rather than linear-light;
955+
secondly,
956+
the weighting factors are those
957+
for the obsolete NTSC color space,
958+
not sRGB.)
959+
950960
(Note, though, that an easier and more accurate way to grayscale a color
951961
is to use the ''lch()'' function,
952962
as that color space is more accurate to human perception:

0 commit comments

Comments
 (0)