RE: [AD] An example of HLS colour-space

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


>-----Original Message-----
>From: alleg-developers-admin@xxxxxxxxxx
>[mailto:alleg-developers-admin@xxxxxxxxxx Behalf Of Eric
>Botcazou
>Sent: 07 June 2003 11:34
>To: alleg-developers@xxxxxxxxxx
>Subject: Re: [AD] An example of HLS colour-space
>
>
>> Apart from getting different results when interpolating in the
>HSV and HLS
>> colour-spaces, the V (value or brightness) and the L (lightness or
>> luminance) represent two different concepts. Brightness corresponds to
>> percieved intensity of a coloured-light, and luminance corresponds to the
>> quantity of light used. Brightness is also a property of
>self-illuminating
>> objects, and lightness is a property of reflecting objects.
>
>We already have a "luminance" blender (see src/colblend.c). Does
>it use the
>same luminance as that of HLS?


The "luminance" blender currently uses the HSV color-space to do it's
blending. HLS is a different color-space to HSV, so a HLS-space based
blender would produce different results to a HSV-space based blender.

Incidentally, in color.c, the 'luminance blender' is incorrectly named. It
should really be called the 'brightness blender' as it uses HSV space
instead of HLS space. If it uses HLS space, then 'luminance blender' (or
'lightness blender') would be the correct name. I propose that
'set_luminance_blender()' be depreciated and replaced with
'set_brightness_blender()' and all internal code renamed appropriately. I
would volonteer to do this myself. If ever blenders are added that use HLS
space, then we would use 'set_lightness_blender()'

In HSV space, the V (value/brightness) represents how bright a color is
(percieved intensity of the coloured light), and S determines how far away a
color is from the monochrome value of the colour's pervieved intensity. In
HLS space, the L (lightness/luminance) represents how light a color is from
black to white, where colours can be at their most colourful in the middle
(where L=0.5). S controls how 'colourful' the resulting colour with the
given light-intensity is (or how pure the colour is). In both colour-spaces,
Hue is the same quantity.

The excolspc program I posted earlier shows you the differences between the
two color-spaces and is a graphical demonstration of what I explained here.
I am currently working on a screensaver that makes good use of both the HLS
and HSV color-spaces.


AE.






Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/