User Tools

Site Tools


Sidebar

hpl3:community:scripting:classes:ccolor

cColor

Constructors

Constructor Description
cColor() Creates a color with a default value of opaque black.
cColor(float, float) Creates a color with the first parameter given to RGB and the second parameter given to A.
cColor(float, float, float) Creates a color using the given values as RGB data.
cColor(float, float, float, float) Creates a color using the given values as RGBA data.

Fields

Field Name Type Description
r float The value of the red channel.
g float The value of the green channel.
b float The value of the blue channel.
a float The value of the alpha channel.

Functions

Return Type Function Name Parameters Description
cColor ToLinearSpace const float afPower,
const bool abCorrectAlpha,
const
Returns the color converted into the linear space.
cColor ToSRGB const bool abCorrectAlpha,
const
Returns the color converted into the sRGB space.

Remarks

Color channel values are stored using a 0.0 - 1.0 range, where 0.0 is equal to 0 and 1.0 is equal to 255.

Read this post on StackOverflow for an explanation on the differences between the linear color space and the sRGB color space.

hpl3/community/scripting/classes/ccolor.1469912411.txt.gz · Last modified: 2016/07/30 21:00 by abion47