Difference between revisions of "HPL3/SOMA/Scripting/cColor"
Jump to navigation
Jump to search
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | Color channel values are stored using a 0.0 - 1.0 range | + | A four-channel color unit which stores float-based RGBA data. Color channel values are stored using a 0.0 - 1.0 range. |
− | |||
− | |||
== Constructors == | == Constructors == | ||
Line 8: | Line 6: | ||
! Constructor !! Description | ! Constructor !! Description | ||
|- | |- | ||
− | | <syntaxhighlight lang="c++">cColor()</syntaxhighlight> || Creates a color with a default value of opaque black. | + | | <syntaxhighlight lang="c++" inline>cColor()</syntaxhighlight> || Creates a color with a default value of opaque black. |
|- | |- | ||
− | | <syntaxhighlight lang="c++">cColor(float, float)</syntaxhighlight> || 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. | + | | <syntaxhighlight lang="c++" inline>cColor(float, float)</syntaxhighlight> || 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. |
|- | |- | ||
− | | <syntaxhighlight lang="c++">cColor(float, float, float)</syntaxhighlight> || Creates an opaque color using the given values as RGB data. | + | | <syntaxhighlight lang="c++" inline>cColor(float, float, float)</syntaxhighlight> || Creates an opaque color using the given values as RGB data. |
|- | |- | ||
− | | <syntaxhighlight lang="c++">cColor(float, float, float, float)</syntaxhighlight> || Creates a color using the given values as RGBA data. | + | | <syntaxhighlight lang="c++" inline>cColor(float, float, float, float)</syntaxhighlight> || Creates a color using the given values as RGBA data. |
|} | |} | ||
Line 22: | Line 20: | ||
! Field Name !! Type !! Description | ! Field Name !! Type !! Description | ||
|- | |- | ||
− | | r || <syntaxhighlight lang="c++">float</syntaxhighlight> || The value of the red channel. | + | | r || <syntaxhighlight lang="c++" inline>float</syntaxhighlight> || The value of the red channel. |
|- | |- | ||
− | | g || <syntaxhighlight lang="c++">float</syntaxhighlight> || The value of the green channel. | + | | g || <syntaxhighlight lang="c++" inline>float</syntaxhighlight> || The value of the green channel. |
|- | |- | ||
− | | b || <syntaxhighlight lang="c++">float</syntaxhighlight> || The value of the blue channel. | + | | b || <syntaxhighlight lang="c++" inline>float</syntaxhighlight> || The value of the blue channel. |
|- | |- | ||
− | | a || <syntaxhighlight lang="c++">float</syntaxhighlight> || The value of the alpha channel. | + | | a || <syntaxhighlight lang="c++" inline>float</syntaxhighlight> || The value of the alpha channel. |
|} | |} | ||
Line 36: | Line 34: | ||
! Return Type !! Function Name !! Parameters !! Description | ! Return Type !! Function Name !! Parameters !! Description | ||
|- | |- | ||
− | | [[ | + | | [[../cColor|<syntaxhighlight lang="c++" inline>cColor</syntaxhighlight>]] || ToLinearSpace || <syntaxhighlight lang="c++" inline>const float afPower,</syntaxhighlight><br /><syntaxhighlight lang="c++" inline>const bool abCorrectAlpha,</syntaxhighlight><br /><syntaxhighlight lang="c++" inline>const</syntaxhighlight> || Returns the color converted into the linear space. (See remarks.) |
− | const bool abCorrectAlpha, | ||
− | const</syntaxhighlight> || Returns the color converted into the linear space. | ||
|- | |- | ||
− | | [[ | + | | [[../cColor|<syntaxhighlight lang="c++" inline>cColor</syntaxhighlight>]] || ToSRGB || <syntaxhighlight lang="c++" inline>const bool abCorrectAlpha,</syntaxhighlight><br /><syntaxhighlight lang="c++" inline>const</syntaxhighlight> || Returns the color converted into the [[wikipedia:sRGB|sRGB]] space. (See remarks. |
− | const</syntaxhighlight> || Returns the color converted into the [[wikipedia:sRGB|sRGB]] space. | ||
|} | |} | ||
− | [ | + | == Remarks == |
− | + | ||
− | + | 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. | |
+ | |||
+ | {{ReferencesSection}} | ||
+ | |||
+ | {{HPL3SOMAScriptingCategories}} | ||
__FORCETOC__ | __FORCETOC__ |
Latest revision as of 14:25, 6 August 2020
A four-channel color unit which stores float-based RGBA data. Color channel values are stored using a 0.0 - 1.0 range.
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
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. (See remarks.) |
cColor |
ToSRGB | const bool abCorrectAlpha, const |
Returns the color converted into the sRGB space. (See remarks. |
Remarks
Read this post on StackOverflow for an explanation on the differences between the linear color space and the sRGB color space.
References
- HPL3/SOMA/Scripting/cBeam (← links)
- HPL3/SOMA/Scripting/cBeamEnd (← links)
- HPL3/SOMA/Scripting/cBillboard (← links)
- HPL3/SOMA/Scripting/cClothEntity (← links)
- HPL3/SOMA/Scripting/cConfigFile (← links)
- HPL3/SOMA/Scripting/cEnvironmentParticles (← links)
- HPL3/SOMA/Scripting/cFogArea (← links)
- HPL3/SOMA/Scripting/cForceField (← links)
- HPL3/SOMA/Scripting/cGuiGfxElement (← links)
- HPL3/SOMA/Scripting/cGuiPopUpColorPicker (← links)
- HPL3/SOMA/Scripting/cGuiSet (← links)
- HPL3/SOMA/Scripting/cImGui (← links)
- HPL3/SOMA/Scripting/cImGuiButtonData (← links)
- HPL3/SOMA/Scripting/cImGuiCheckBoxData (← links)
- HPL3/SOMA/Scripting/cImGuiFont (← links)
- HPL3/SOMA/Scripting/cImGuiFrameData (← links)
- HPL3/SOMA/Scripting/cImGuiFrameGfx (← links)
- HPL3/SOMA/Scripting/cImGuiGaugeData (← links)
- HPL3/SOMA/Scripting/cImGuiGfx (← links)
- HPL3/SOMA/Scripting/cImGuiLabelData (← links)
- HPL3/SOMA/Scripting/cImGuiMultiSelectData (← links)
- HPL3/SOMA/Scripting/cImGuiSliderData (← links)
- HPL3/SOMA/Scripting/cImGuiTextFrameData (← links)
- HPL3/SOMA/Scripting/cImGuiWindowData (← links)
- HPL3/SOMA/Scripting/cLensFlare (← links)
- HPL3/SOMA/Scripting/cLightBox (← links)
- HPL3/SOMA/Scripting/cLightDirectional (← links)
- HPL3/SOMA/Scripting/cLightPoint (← links)
- HPL3/SOMA/Scripting/cLightSpot (← links)
- HPL3/SOMA/Scripting/cLuxAgent (← links)
- HPL3/SOMA/Scripting/cLuxArea (← links)
- HPL3/SOMA/Scripting/cLuxCritter (← links)
- HPL3/SOMA/Scripting/cLuxEdgeGlow (← links)
- HPL3/SOMA/Scripting/cLuxEffectHandler (← links)
- HPL3/SOMA/Scripting/cLuxInputHandler (← links)
- HPL3/SOMA/Scripting/cLuxLiquidArea (← links)
- HPL3/SOMA/Scripting/cLuxProp (← links)
- HPL3/SOMA/Scripting/cLuxSoundscapeArea (← links)
- HPL3/SOMA/Scripting/cLuxVisibilityArea (← links)
- HPL3/SOMA/Scripting/cLuxVisibilityPortal (← links)
- HPL3/SOMA/Scripting/cMeshEntity (← links)
- HPL3/SOMA/Scripting/cParticleSystem (← links)
- HPL3/SOMA/Scripting/cPostEffect ToneMapping (← links)
- HPL3/SOMA/Scripting/cRendererCallbackFunctions (← links)
- HPL3/SOMA/Scripting/cResourceVarsObject (← links)
- HPL3/SOMA/Scripting/cRopeEntity3D (← links)
- HPL3/SOMA/Scripting/cRopeEntityBillboard (← links)
- HPL3/SOMA/Scripting/cSubMeshEntity (← links)
- HPL3/SOMA/Scripting/cWidgetButton (← links)
- HPL3/SOMA/Scripting/cWidgetCheckBox (← links)