Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
hpl3:community:scripting:classes:ccolor [2015/11/06 02:34] abion47 [Functions] |
hpl3:community:scripting:classes:ccolor [2018/04/26 23:23] abion47 [Constructors] |
||
---|---|---|---|
Line 1: | Line 1: | ||
=====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 all the RGB values (the color will be a shade of grey) and the second parameter given to the alpha channel. | | ||
+ | |cColor(float, float, float) |Creates an opaque color using the given values as RGB data. | | ||
+ | |cColor(float, float, float, float) |Creates a color using the given values as RGBA data. | | ||
====Fields==== | ====Fields==== | ||
^ Field Name ^ Type ^ Description ^ | ^ Field Name ^ Type ^ Description ^ | ||
- | | r | float | The value of the red channel, on a 0-1 scale. | | + | | r | float | The value of the red channel. | |
- | | g | float | The value of the green channel, on a 0-1 scale. | | + | | g | float | The value of the green channel. | |
- | | b | float | The value of the blue channel, on a 0-1 scale. | | + | | b | float | The value of the blue channel. | |
- | | a | float | The value of the alpha channel, on a 0-1 scale. | | + | | a | float | The value of the alpha channel. | |
====Functions==== | ====Functions==== | ||
Line 16: | Line 24: | ||
====Remarks==== | ====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 [[http://stackoverflow.com/questions/12524623/what-are-the-practical-differences-when-working-with-colors-in-a-linear-vs-a-no|this post on StackOverflow]] for an explanation on the differences between the linear color space and the sRGB color space. | Read [[http://stackoverflow.com/questions/12524623/what-are-the-practical-differences-when-working-with-colors-in-a-linear-vs-a-no|this post on StackOverflow]] for an explanation on the differences between the linear color space and the sRGB color space. |