![]() |
Open CASCADE Technology Reference Manual 8.0.1
|
The pair of Quantity_Color and Alpha component (1.0 opaque, 0.0 transparent). More...
#include <Quantity_ColorRGBA.hxx>
Public Member Functions | |
| Quantity_ColorRGBA () | |
| Creates a color with the default value. | |
| constexpr | Quantity_ColorRGBA (const Quantity_Color &theRgb) |
| Creates the color with specified RGB value. | |
| constexpr | Quantity_ColorRGBA (const Quantity_Color &theRgb, float theAlpha) |
| Creates the color with specified RGBA values. | |
| Quantity_ColorRGBA (const NCollection_Vec4< float > &theRgba) | |
| Creates the color from RGBA vector. | |
| Quantity_ColorRGBA (float theRed, float theGreen, float theBlue, float theAlpha) | |
| Creates the color from RGBA values. | |
| void | SetValues (float theRed, float theGreen, float theBlue, float theAlpha) noexcept |
| Assign new values to the color. | |
| constexpr const Quantity_Color & | GetRGB () const noexcept |
| Return RGB color value. | |
| constexpr Quantity_Color & | ChangeRGB () noexcept |
| Modify RGB color components without affecting alpha value. | |
| constexpr void | SetRGB (const Quantity_Color &theRgb) noexcept |
| Assign RGB color components without affecting alpha value. | |
| constexpr float | Alpha () const noexcept |
| Return alpha value (1.0 means opaque, 0.0 means fully transparent). | |
| constexpr void | SetAlpha (const float theAlpha) noexcept |
| Assign the alpha value. | |
| operator const NCollection_Vec4< float > & () const noexcept | |
| Return the color as vector of 4 float elements. | |
| bool | IsDifferent (const Quantity_ColorRGBA &theOther) const noexcept |
| Returns true if the distance between colors is greater than Epsilon(). | |
| bool | operator!= (const Quantity_ColorRGBA &theOther) const noexcept |
| Returns true if the distance between colors is greater than Epsilon(). | |
| bool | IsEqual (const Quantity_ColorRGBA &theOther) const noexcept |
| Two colors are considered to be equal if their distance is no greater than Epsilon(). | |
| bool | operator== (const Quantity_ColorRGBA &theOther) const noexcept |
| Two colors are considered to be equal if their distance is no greater than Epsilon(). | |
| void | DumpJson (Standard_OStream &theOStream, int theDepth=-1) const |
| Dumps the content of me into the stream. | |
| bool | InitFromJson (const Standard_SStream &theSStream, int &theStreamPos) |
| Inits the content of me from the stream. | |
Static Public Member Functions | |
| static bool | ColorFromName (const char *const theColorNameString, Quantity_ColorRGBA &theColor) noexcept |
| Finds color from predefined names. For example, the name of the color which corresponds to "BLACK" is Quantity_NOC_BLACK. An alpha component is set to 1.0. | |
| static bool | ColorFromHex (const char *const theHexColorString, Quantity_ColorRGBA &theColor, const bool theAlphaComponentIsOff=false) |
| Parses the string as a hex color (like "#FF0" for short sRGB color, "#FF0F" for short sRGBA color, "#FFFF00" for RGB color, or "#FFFF00FF" for RGBA color). | |
| static TCollection_AsciiString | ColorToHex (const Quantity_ColorRGBA &theColor, const bool theToPrefixHash=true) noexcept |
| Returns hex sRGBA string in format "#RRGGBBAA". | |
| static NCollection_Vec4< float > | Convert_LinearRGB_To_sRGB (const NCollection_Vec4< float > &theRGB) noexcept |
| Convert linear RGB components into sRGB using OpenGL specs formula. | |
| static NCollection_Vec4< float > | Convert_sRGB_To_LinearRGB (const NCollection_Vec4< float > &theRGB) noexcept |
| Convert sRGB components into linear RGB using OpenGL specs formula. | |
The pair of Quantity_Color and Alpha component (1.0 opaque, 0.0 transparent).
|
inline |
Creates a color with the default value.
|
inlineexplicitconstexpr |
Creates the color with specified RGB value.
|
inlineconstexpr |
Creates the color with specified RGBA values.
|
inlineexplicit |
Creates the color from RGBA vector.
|
inline |
Creates the color from RGBA values.
|
inlineconstexprnoexcept |
Return alpha value (1.0 means opaque, 0.0 means fully transparent).
|
inlineconstexprnoexcept |
Modify RGB color components without affecting alpha value.
|
static |
Parses the string as a hex color (like "#FF0" for short sRGB color, "#FF0F" for short sRGBA color, "#FFFF00" for RGB color, or "#FFFF00FF" for RGBA color).
| theHexColorString | the string to be parsed |
| theColor | a color that is a result of parsing |
| theAlphaComponentIsOff | the flag that indicates if a color alpha component is presented in the input string (false) or not (true) |
|
inlinestaticnoexcept |
Finds color from predefined names. For example, the name of the color which corresponds to "BLACK" is Quantity_NOC_BLACK. An alpha component is set to 1.0.
| theColorNameString | the color name |
| theColor | a found color |
|
inlinestaticnoexcept |
Returns hex sRGBA string in format "#RRGGBBAA".
|
inlinestaticnoexcept |
Convert linear RGB components into sRGB using OpenGL specs formula.
|
inlinestaticnoexcept |
Convert sRGB components into linear RGB using OpenGL specs formula.
| void Quantity_ColorRGBA::DumpJson | ( | Standard_OStream & | theOStream, |
| int | theDepth = -1 ) const |
Dumps the content of me into the stream.
|
inlineconstexprnoexcept |
Return RGB color value.
| bool Quantity_ColorRGBA::InitFromJson | ( | const Standard_SStream & | theSStream, |
| int & | theStreamPos ) |
Inits the content of me from the stream.
|
inlinenoexcept |
Returns true if the distance between colors is greater than Epsilon().
|
inlinenoexcept |
Two colors are considered to be equal if their distance is no greater than Epsilon().
|
inlinenoexcept |
Return the color as vector of 4 float elements.
|
inlinenoexcept |
Returns true if the distance between colors is greater than Epsilon().
|
inlinenoexcept |
Two colors are considered to be equal if their distance is no greater than Epsilon().
|
inlineconstexprnoexcept |
Assign the alpha value.
|
inlineconstexprnoexcept |
Assign RGB color components without affecting alpha value.
|
inlinenoexcept |
Assign new values to the color.