ClanSoft logo
ClanSoft logo

    CL_Color::get_color

Syntax

static float get_color(
        unsigned int cmask,
        int color);

Parameters

cmask-the bit mask for the color component you want
color-the color to extract the component from

Return value

the R, G, B or A value as a floating point

Description

Takes a color, extracts the color component

(red, green, blue or alpha) specified by cmask, and returns it as a floating point. (The floating point value is the amount of the color component divided by that color component's maximum value.)

For example:

If the red component has a maximum value of 255, and the red component of your color was 200, the floating point returned would be 200/255 or 0.7843


Back to index



This page was built using the Perceps documentation system.