Re: [css3-transitions] colour space used for colour interpolations

Reading a bit more on the wikipedia article [1] on HSL, I came across the
following quote:

Because hue is a circular quantity, represented numerically with a
discontinuity at 360°, it is difficult to use in statistical computations
or quantitative comparisons: analysis requires the use of circular
statistics <http://en.wikipedia.org/wiki/Directional_statistics>.
Furthermore, hue is defined piecewise, in 60° chunks, where the
relationship of lightness, value, and chroma to *R*, *G*, and *B* depends
on the hue chunk in question. *This definition introduces discontinuities,
corners which can plainly be seen in horizontal slices of HSL or HSV*.

I believe it doesn't make sense to transition in HSL because of these
issue. Who would want to create such a synthetic transition?

Rik


[1] http://en.wikipedia.org/wiki/HSL_and_HSV

On Mon, May 21, 2012 at 3:15 PM, Rik Cabanier <cabanier@gmail.com> wrote:

>
>
> On Mon, May 21, 2012 at 10:16 AM, Tab Atkins Jr. <jackalmage@gmail.com>wrote:
>
>> On Sun, May 20, 2012 at 11:26 AM, Rik Cabanier <cabanier@gmail.com>
>> wrote:
>> > On Fri, May 18, 2012 at 3:43 AM, Cameron McCormack <cam@mcc.id.au>
>> wrote:
>> >> In SVG, the color-interpolation property is used to control the colour
>> >> space in which SVG animations on properties like fill, stroke and
>> stop-color
>> >> are performed.  Should this apply to CSS Transitions and Animations on
>> >> properties that take colours too?  It'd be good to have the same
>> >> interpolations available in both kinds of animation.
>> >>
>> >> (Brian mentioned to me that people also want to be able to interpolate
>> in
>> >> other colour spaces, like HSL or L*a*b too -- we could extend
>> >> color-interpolation with options for that.)
>> >
>> > I'm not sure if it makes sense to have interpolation in HSL. It seems
>> that
>> > it introduces more complexities than needed. Authors probably feel that
>> it
>> > should interpolate like RGB since it's just a different representation
>> and
>> > not really a new colorspace.
>>
>> No, in my experience authors definitely want something that, for
>> example, transitions from green to blue without passing through gray
>> in the middle.  We think in terms of the color wheel, not the RGB
>> cube.  Whether that "something" is a transition in HSL space, or a
>> transition in some other space with similar-but-better results
>> (CIELCH?), probably doesn't matter that much.
>>
>
> How do we find out if this is useful for authors?
> I agree that they can look at the HSL color wheel and see how the colors
> would transition.
>
>
>>
>> > Lab would be nice to have since it will interpolate in a visually
>> pleasing
>> > way. The conversion from Lab to RGB will also work around the problem
>> where
>> > the sRGB response curve makes intermediate values looks too dark/muddy.
>> >
>> > If we can make Lab a first class citizen, there is no more need to
>> > color-interpolation so it's better to not go through the trouble of
>> speccing
>> > and implementing it.
>> > At some point, we should look into better color management in the
>> browser.
>> > color-interpolation and color-interpolation-filters are rooted in the
>> world
>> > of monitors. Modern devices can display more colors than sRGB so we
>> should
>> > find a way to expose that.
>>
>> I'd enjoy getting Lab into the browser, though I don't understand what
>> difficulties may lie in the way.
>
>
> I don't think it would be that hard. For almost all content, the color
> would immediately translate from Lab to sRGB (with the exception of
> gradients).
> If we later on define a way to change the default colorspace from sRGB,
> the Lab values would translate to that.
>
> Rik
>

Received on Thursday, 24 May 2012 16:45:25 UTC