#include <opennurbs_color.h>

Public Types

enum  RGBA_byte_index : unsigned int { kRedByteIndex = 0, kGreenByteIndex = 1, kBlueByteIndex = 2, kAlphaByteIndex = 3 }
 
enum  RGBA_shift : unsigned int
 

Public Member Functions

 ON_Color ()=default
 
 ON_Color (const ON_Color &)=default
 
 ON_Color (int red, int green, int blue)
 Sets A = 0. More...
 
 ON_Color (int red, int green, int blue, int alpha)
 
 ON_Color (unsigned int colorref)
 
 ~ON_Color ()=default
 
int Alpha () const
 
int Blue () const
 
int Compare (const ON_Color &) const
 < 0 if this < arg, 0 ir this==arg, > 0 if this > arg More...
 
double FractionAlpha () const
 
double FractionBlue () const
 
double FractionGreen () const
 
double FractionRed () const
 
int Green () const
 
double Hue () const
 
 operator unsigned int () const
 Conversion to Windows COLORREF in little endian RGBA order. More...
 
ON_Coloroperator= (const ON_Color &)=default
 
int Red () const
 
double Saturation () const
 Returns 0.0 (gray) to 1.0 (saturated) More...
 
void SetAlpha (int alpha)
 
void SetFractionalAlpha (double alpha)
 
void SetFractionalRGB (double red, double green, double blue)
 
void SetFractionalRGBA (double red, double green, double blue, double alpha)
 input args More...
 
void SetHSV (double h, double s, double v)
 
void SetRGB (int red, int green, int blue)
 
void SetRGBA (int red, int green, int blue, int alpha)
 
double Value () const
 Returns 0.0 (black) to 1.0 (white) More...
 
unsigned int WindowsRGB () const
 Call this function when the color is needed in a Windows COLORREF format with alpha = 0; Returns A Windows COLOREF with alpha = 0. More...
 

Static Public Attributes

static const ON_Color Black
 
static const ON_Color Gray126
 
static const ON_Color Gray160
 
static const ON_Color Gray230
 
static const ON_Color SaturatedBlue
 
static const ON_Color SaturatedCyan
 
static const ON_Color SaturatedGreen
 
static const ON_Color SaturatedMagenta
 
static const ON_Color SaturatedRed
 
static const ON_Color SaturatedYellow
 
static const ON_Color UnsetColor
 
static const ON_Color White
 

Member Enumeration Documentation

◆ RGBA_byte_index

enum ON_Color::RGBA_byte_index : unsigned int
Enumerator
kRedByteIndex 

same for both little and big endian computers.

kGreenByteIndex 
kBlueByteIndex 
kAlphaByteIndex 

◆ RGBA_shift

enum ON_Color::RGBA_shift : unsigned int

Constructor & Destructor Documentation

◆ ON_Color() [1/5]

ON_Color::ON_Color ( )
default

◆ ~ON_Color()

ON_Color::~ON_Color ( )
default

◆ ON_Color() [2/5]

ON_Color::ON_Color ( const ON_Color )
default

◆ ON_Color() [3/5]

ON_Color::ON_Color ( int  red,
int  green,
int  blue 
)

Sets A = 0.

◆ ON_Color() [4/5]

ON_Color::ON_Color ( int  red,
int  green,
int  blue,
int  alpha 
)

◆ ON_Color() [5/5]

ON_Color::ON_Color ( unsigned int  colorref)
Parameters
colorref[in] Windows COLORREF in little endian RGBA order.

Member Function Documentation

◆ Alpha()

int ON_Color::Alpha ( ) const

◆ Blue()

int ON_Color::Blue ( ) const

◆ Compare()

int ON_Color::Compare ( const ON_Color ) const

< 0 if this < arg, 0 ir this==arg, > 0 if this > arg

◆ FractionAlpha()

double ON_Color::FractionAlpha ( ) const

◆ FractionBlue()

double ON_Color::FractionBlue ( ) const

◆ FractionGreen()

double ON_Color::FractionGreen ( ) const

◆ FractionRed()

double ON_Color::FractionRed ( ) const

◆ Green()

int ON_Color::Green ( ) const

◆ Hue()

double ON_Color::Hue ( ) const

◆ operator unsigned int()

ON_Color::operator unsigned int ( ) const

Conversion to Windows COLORREF in little endian RGBA order.

◆ operator=()

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

◆ Red()

int ON_Color::Red ( ) const

◆ Saturation()

double ON_Color::Saturation ( ) const

Returns 0.0 (gray) to 1.0 (saturated)

◆ SetAlpha()

void ON_Color::SetAlpha ( int  alpha)

◆ SetFractionalAlpha()

void ON_Color::SetFractionalAlpha ( double  alpha)

◆ SetFractionalRGB()

void ON_Color::SetFractionalRGB ( double  red,
double  green,
double  blue 
)

◆ SetFractionalRGBA()

void ON_Color::SetFractionalRGBA ( double  red,
double  green,
double  blue,
double  alpha 
)

input args

◆ SetHSV()

void ON_Color::SetHSV ( double  h,
double  s,
double  v 
)

◆ SetRGB()

void ON_Color::SetRGB ( int  red,
int  green,
int  blue 
)

◆ SetRGBA()

void ON_Color::SetRGBA ( int  red,
int  green,
int  blue,
int  alpha 
)

◆ Value()

double ON_Color::Value ( ) const

Returns 0.0 (black) to 1.0 (white)

◆ WindowsRGB()

unsigned int ON_Color::WindowsRGB ( ) const

Call this function when the color is needed in a Windows COLORREF format with alpha = 0; Returns A Windows COLOREF with alpha = 0.

Member Data Documentation

◆ Black

const ON_Color ON_Color::Black
static

◆ Gray126

const ON_Color ON_Color::Gray126
static

◆ Gray160

const ON_Color ON_Color::Gray160
static

◆ Gray230

const ON_Color ON_Color::Gray230
static

◆ m_color

unsigned int ON_Color::m_color = 0

◆ m_RGBA

unsigned char ON_Color::m_RGBA[4]

◆ SaturatedBlue

const ON_Color ON_Color::SaturatedBlue
static

◆ SaturatedCyan

const ON_Color ON_Color::SaturatedCyan
static

◆ SaturatedGreen

const ON_Color ON_Color::SaturatedGreen
static

◆ SaturatedMagenta

const ON_Color ON_Color::SaturatedMagenta
static

◆ SaturatedRed

const ON_Color ON_Color::SaturatedRed
static

◆ SaturatedYellow

const ON_Color ON_Color::SaturatedYellow
static

◆ UnsetColor

const ON_Color ON_Color::UnsetColor
static

◆ White

const ON_Color ON_Color::White
static