Hide menu
Loading...
Searching...
No Matches

Defines an RGBA color (with alpha channel). More...

Inherits global.SystemIDisposable.

Public Member Functions

 Color (global::System.IntPtr cPtr, bool cMemoryOwn)
 
void Dispose ()
 
 Color ()
 Creates an uninitialized color.
 
 Color (uint theRGB, float theAlpha)
 
 Color (uint theRGB)
 
 Color (string theHexCode)
 Creates a color from a hex code in RGB ("#FF0000") or RGBA ("#FF0000FF") formats.
 
 Color (int theR, int theG, int theB, int theAlpha)
 Creates a color with explicit values.
 
 Color (int theR, int theG, int theB)
 
 Color (float theR, float theG, float theB, float theAlpha)
 Creates a color with explicit values.
 
 Color (float theR, float theG, float theB)
 
float R ()
 
float G ()
 
float B ()
 
float A ()
 
void SetR (float theR)
 
void SetG (float theG)
 
void SetB (float theB)
 
void SetA (float theA)
 
void SetValue (int theIndex, float theValue)
 theIndex must be in the [0, 3] range.
 
void SetValues (float theR, float theG, float theB, float theAlpha)
 Sets color components.
 
uint ToRGB ()
 
uint ToRGBA ()
 
bool IsNull ()
 Returns true if color components were unset.
 
bool IsEqual (cadex.Materials.Color theOther, float theTolerance)
 Returns true if two colors are equal with an accuracy of theTolerance.
 
bool IsEqual (cadex.Materials.Color theOther)
 
float Access (uint theIndex)
 

Static Public Member Functions

static cadex.Materials.Color FromRGB (uint theRGB)
 
static cadex.Materials.Color FromRGBA (uint theRGBA)
 

Protected Member Functions

virtual void Dispose (bool disposing)
 

Detailed Description

Defines an RGBA color (with alpha channel).

Components must be within a [0, 1] range.

Examples
MTKConverter/Program.cs, MTKConverter/main.cxx, utilities/thumbnail_generation/Program.cs, and utilities/thumbnail_generation/main.cxx.

Constructor & Destructor Documentation

◆ Color() [1/4]

cadex.Materials.Color.Color ( )
inline

Creates an uninitialized color.

IsNull() will return true. Constructor.

◆ Color() [2/4]

cadex.Materials.Color.Color ( string theHexCode)
inline

Creates a color from a hex code in RGB ("#FF0000") or RGBA ("#FF0000FF") formats.

Constructor.

◆ Color() [3/4]

cadex.Materials.Color.Color ( int theR,
int theG,
int theB,
int theAlpha )
inline

Creates a color with explicit values.

Each value must be within [0, 255] range. Constructor.

◆ Color() [4/4]

cadex.Materials.Color.Color ( float theR,
float theG,
float theB,
float theAlpha )
inline

Creates a color with explicit values.

Each value must be within [0, 1] range. Constructor.

Member Function Documentation

◆ IsEqual()

bool cadex.Materials.Color.IsEqual ( cadex.Materials.Color theOther,
float theTolerance )
inline

Returns true if two colors are equal with an accuracy of theTolerance.

◆ IsNull()

bool cadex.Materials.Color.IsNull ( )
inline

Returns true if color components were unset.

◆ SetValue()

void cadex.Materials.Color.SetValue ( int theIndex,
float theValue )
inline

theIndex must be in the [0, 3] range.

Sets individual color components.

◆ SetValues()

void cadex.Materials.Color.SetValues ( float theR,
float theG,
float theB,
float theAlpha )
inline

Sets color components.