a hsl color vector
an rgb color vector
| |
|
|
| |
Implementation
01 function hsl_rgb( hsl_ )
02 dim h: h = hsl_( COLOR_H )
03 dim s: s = hsl_( COLOR_S )
04 dim l: l = hsl_( COLOR_L )
05
06 if( s = 0.0 ) then
07 dim t: t = int( l * NUMBER_MAX_BYTE )
08 hsl_rgb = array( t, t, t )
09 else
10 dim lo, hi
11 if( l < 0.5 ) then
12 hi = l * ( 1.0 + s )
13 else
14 hi = ( l + s ) - ( s * l )
15 end if
16 lo = 2.0 * l - hi
17
18 dim r: r = int( NUMBER_MAX_BYTE * hue_value( h + 1.0 / 3.0, lo, hi ) )
19 dim g: g = int( NUMBER_MAX_BYTE * hue_value( h, lo, hi ) )
20 dim b: b = int( NUMBER_MAX_BYTE * hue_value( h - 1.0 / 3.0, lo, hi ) )
21
22 hsl_rgb = array( r, g, b )
23 end if
24 end function
|
|
| |
|
|
|