Re: Color Lightening and Darkening

Mikko Rantalainen wrote:
> suggest that if relative colors are introduced, then an another property
> "min-foreground-background-absolute-difference" (a shorter name would be
> nice) should be added, too. The behavior for that property would be to
> specify minimum value for function
> 
> 	abs(r1-r2) + abs(g1-g2) + abs(b1-b2)
> 
> where abs() returns absolute value and r1 is red color component value

If you are going to do this, you should use the same algorithm as used 
in W3C's web accessibility guidelines.  That may not be the current 
algorithm, as I have some reservations about whether it really reflects 
the behaviour of they eye.

That is basically convert to total power flux with different weights for 
red, green, and blue, then impose a minimum ratio between the two 
values, offset by constants.  Total power is got by undoing the sRGB 
correction, then adding together with weights which, I suspect, are the 
luminance weights, used to get the Y signal in colour TV.  The ratio 
part could be described by saying that you take a function that is 
asymptotic to a logarithm, for large values, and asymptotic to a 
constant for small values, and requiring a certain absolute difference.

-- 
David Woolley
Emails are not formal business letters, whatever businesses may want.
RFC1855 says there should be an address here, but, in a world of spam,
that is no longer good advice, as archive address hiding may not work.

Received on Monday, 1 September 2008 21:23:26 UTC