[Cogl] [PATCH 1/3] color: Add HSL conversion functions

Damien Lespiau damien.lespiau at intel.com
Wed May 29 13:50:56 PDT 2013


I fixed the nice catches and pushed the resulting commits (and ended up
using cogl_color_init_from_4f() indeed). Also added the test needed to
exercise the saturation == 0 code path in init_from_hsl().

Thanks for the reviews!

-- 
Damien

On Tue, May 28, 2013 at 03:05:02PM +0100, Robert Bragg wrote:
>    Right, in Rig we use rut_color_init_from_4f in this case, maybe we could
>    do the same kind of thing here.
> 
>    Regards, - Robert
> 
>    On May 28, 2013 2:59 PM, "Neil Roberts" <neil at linux.intel.com> wrote:
> 
>      Robert Bragg <robert at sixbynine.org> writes:
> 
>      > I just realized that this bit also needs to initialize the alpha
>      component:
>      >
>      > +  if (saturation == 0)
>      > +    {
>      > +      color->red = color->green = color->blue = (luminance * 255);
>      > +
>      > +      return;
>      > +    }
> 
>      Looks like it also shouldn't multiply by 255 seeing as CoglColors are
>      floats.
> 
>      Regards,
>      - Neil
>      ---------------------------------------------------------------------
>      Intel Corporation (UK) Limited
>      Registered No. 1134945 (England)
>      Registered Office: Pipers Way, Swindon SN3 1RJ
>      VAT No: 860 2173 47
> 
>      This e-mail and any attachments may contain confidential material for
>      the sole use of the intended recipient(s). Any review or distribution
>      by others is strictly prohibited. If you are not the intended
>      recipient, please contact the sender and delete all copies.
> 
>      _______________________________________________
>      Cogl mailing list
>      Cogl at lists.freedesktop.org
>      http://lists.freedesktop.org/mailman/listinfo/cogl


More information about the Cogl mailing list