Logo Search packages:      
Sourcecode: inkscape version File versions

void sp_color_hsl_to_rgb_floatv ( float *  rgb,
float  h,
float  s,
float  l 
)

Fill rgb float array from h,s,l float values.

Definition at line 370 of file color.cpp.

{
    if (s == 0) {
        rgb[0] = l;
        rgb[1] = l;
        rgb[2] = l;
    } else {
        float v2;
        if (l < 0.5) {
            v2 = l * (1 + s);
        } else {
            v2 = l + s - l*s;
        }
        float v1 = 2*l - v2;

        rgb[0] = hue_2_rgb (v1, v2, h*6 + 2.0);
        rgb[1] = hue_2_rgb (v1, v2, h*6);
        rgb[2] = hue_2_rgb (v1, v2, h*6 - 2.0);
    }
}


Generated by  Doxygen 1.6.0   Back to index