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 ()
 Constructor.
 
 Color (uint theRGB, float theAlpha)
 
 Color (uint theRGB)
 
 Color (string theHexCode)
 Constructor.
 
 Color (int theR, int theG, int theB, int theAlpha)
 Constructor.
 
 Color (int theR, int theG, int theB)
 
 Color (float theR, float theG, float theB, float theAlpha)
 Constructor.
 
 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)
 Sets individual color components.
 
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

Constructor.

Creates an uninitialized color. IsNull() will return true.

◆ Color() [2/4]

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

Constructor.

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

◆ Color() [3/4]

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

Constructor.

Creates a color with explicit values. Each value must be within [0, 255] range.

◆ Color() [4/4]

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

Constructor.

Creates a color with explicit values. Each value must be within [0, 1] range.

Member Function Documentation

◆ SetValue()

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

Sets individual color components.

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