Rhino C++ API  8.14
Public Member Functions | Static Public Attributes | List of all members
ON_4fColor Class Reference

#include <opennurbs_color.h>

Public Member Functions

 ON_4fColor ()
 
 ON_4fColor (const ON_4fColor &)=default
 
 ON_4fColor (const ON_Color &)
 Note that this function will set the alpha correctly from ON_Color's 'inverted' alpha. More...
 
 ON_4fColor (float r, float g, float b, float a)
 
 ON_4fColor (int r, int g, int b, int a)
 
 ~ON_4fColor ()=default
 
float Alpha (void) const
 Alpha in ON_4fColor is OPACITY, not transparency as in ON_Color. More...
 
void BlendTo (float t, const ON_4fColor &col, bool clampAlpha=false)
 
float Blue (void) const
 
int Compare (const ON_4fColor &other) const
 Returns: < 0 if (this < other), 0 if (this == other), > 0 if (this > other). More...
 
float * FloatArray (void)
 
const float * FloatArray (void) const
 
float Green (void) const
 
bool IsValid (class ON_TextLog *text_log=nullptr) const
 
 operator ON_Color (void) const
 Will invert the opacity alpha to transparency. More...
 
bool operator!= (const ON_4fColor &)
 
ON_4fColoroperator= (const ON_4fColor &)=default
 
ON_4fColoroperator= (const ON_Color &)
 
bool operator== (const ON_4fColor &)
 
float Red (void) const
 
void SetAlpha (float a)
 
void SetBlue (float b)
 
void SetGreen (float g)
 
void SetRed (float r)
 
void SetRGBA (float r, float g, float b, float a)
 

Static Public Attributes

static const ON_4fColor Unset
 

Constructor & Destructor Documentation

◆ ON_4fColor() [1/5]

ON_4fColor::ON_4fColor ( )

◆ ~ON_4fColor()

ON_4fColor::~ON_4fColor ( )
default

◆ ON_4fColor() [2/5]

ON_4fColor::ON_4fColor ( int  r,
int  g,
int  b,
int  a 
)

◆ ON_4fColor() [3/5]

ON_4fColor::ON_4fColor ( float  r,
float  g,
float  b,
float  a 
)

◆ ON_4fColor() [4/5]

ON_4fColor::ON_4fColor ( const ON_4fColor )
default

◆ ON_4fColor() [5/5]

ON_4fColor::ON_4fColor ( const ON_Color )

Note that this function will set the alpha correctly from ON_Color's 'inverted' alpha.

Member Function Documentation

◆ Alpha()

float ON_4fColor::Alpha ( void  ) const

Alpha in ON_4fColor is OPACITY, not transparency as in ON_Color.

◆ BlendTo()

void ON_4fColor::BlendTo ( float  t,
const ON_4fColor col,
bool  clampAlpha = false 
)

Blend this color to 'col' using 't' from 0.0 to 1.0. Note: Does not clamp 't' or RGB result unless clampAlpha is true, in which case alpha is clamped.

◆ Blue()

float ON_4fColor::Blue ( void  ) const

◆ Compare()

int ON_4fColor::Compare ( const ON_4fColor other) const

Returns: < 0 if (this < other), 0 if (this == other), > 0 if (this > other).

◆ FloatArray() [1/2]

float* ON_4fColor::FloatArray ( void  )

Direct read/write access to array of four floats. NOTE: If you access the array beyond the 4th element, the function may crash Rhino.

◆ FloatArray() [2/2]

const float* ON_4fColor::FloatArray ( void  ) const

Direct read access to array of four floats. NOTE: If you access the array beyond the 4th element, the function may crash Rhino.

◆ Green()

float ON_4fColor::Green ( void  ) const

◆ IsValid()

bool ON_4fColor::IsValid ( class ON_TextLog text_log = nullptr) const

◆ operator ON_Color()

ON_4fColor::operator ON_Color ( void  ) const

Will invert the opacity alpha to transparency.

◆ operator!=()

bool ON_4fColor::operator!= ( const ON_4fColor )

◆ operator=() [1/2]

ON_4fColor& ON_4fColor::operator= ( const ON_4fColor )
default

◆ operator=() [2/2]

ON_4fColor& ON_4fColor::operator= ( const ON_Color )

◆ operator==()

bool ON_4fColor::operator== ( const ON_4fColor )

◆ Red()

float ON_4fColor::Red ( void  ) const

◆ SetAlpha()

void ON_4fColor::SetAlpha ( float  a)

◆ SetBlue()

void ON_4fColor::SetBlue ( float  b)

◆ SetGreen()

void ON_4fColor::SetGreen ( float  g)

◆ SetRed()

void ON_4fColor::SetRed ( float  r)

◆ SetRGBA()

void ON_4fColor::SetRGBA ( float  r,
float  g,
float  b,
float  a 
)

Member Data Documentation

◆ Unset

const ON_4fColor ON_4fColor::Unset
static