VEX V5 C++ API
Public Member Functions | Static Public Attributes | List of all members
vex::color Class Reference

Use the color class to create Color objects. More...

Public Member Functions

 color ()
 
 color (int value)
 Creates a color. More...
 
 color (uint8_t r, uint8_t g, uint8_t b)
 Creates a color using red, green, and blue values. More...
 
 ~color ()
 
uint32_t rgb (uint32_t value)
 
uint32_t rgb (uint8_t r, uint8_t g, uint8_t b)
 
void operator= (uint32_t value)
 
uint32_t rgb () const
 
 operator uint32_t () const
 
bool isTransparent () const
 Gets the state of the color's transparency. More...
 
colorhsv (uint32_t hue, double sat, double value)
 Creates a color using hue, saturation, and brightness values. More...
 
colorweb (const char *color)
 Creates a color using a hexadecimal value. More...
 

Static Public Attributes

static const color black
 Represents the color black. More...
 
static const color white
 Represents the color white. More...
 
static const color red
 Represents the color red. More...
 
static const color green
 Represents the color green. More...
 
static const color blue
 Represents the color blue. More...
 
static const color yellow
 Represents the color yellow. More...
 
static const color orange
 Represents the color orange. More...
 
static const color purple
 Represents the color purple. More...
 
static const color cyan
 Represents the color cyan. More...
 
static const color transparent
 Represents the color transparent. More...
 

Detailed Description

Use the color class to create Color objects.

Constructor & Destructor Documentation

◆ color() [1/3]

vex::color::color ( )

◆ color() [2/3]

vex::color::color ( int  value)

Creates a color.

Parameters
valueThe value of the color.

◆ color() [3/3]

vex::color::color ( uint8_t  r,
uint8_t  g,
uint8_t  b 
)

Creates a color using red, green, and blue values.

Parameters
rthe color of red on a scale of 0 to 255.
gthe color of green on a scale of 0 to 255.
bthe color of blue on a scale of 0 to 255.

◆ ~color()

vex::color::~color ( )

Member Function Documentation

◆ rgb() [1/3]

uint32_t vex::color::rgb ( uint32_t  value)

◆ rgb() [2/3]

uint32_t vex::color::rgb ( uint8_t  r,
uint8_t  g,
uint8_t  b 
)

◆ operator=()

void vex::color::operator= ( uint32_t  value)

◆ rgb() [3/3]

uint32_t vex::color::rgb ( ) const

◆ operator uint32_t()

vex::color::operator uint32_t ( ) const

◆ isTransparent()

bool vex::color::isTransparent ( ) const

Gets the state of the color's transparency.

Returns
Returns true if the color is transparent.

◆ hsv()

color& vex::color::hsv ( uint32_t  hue,
double  sat,
double  value 
)

Creates a color using hue, saturation, and brightness values.

Returns
Returns a reference to a color.
Parameters
hueAn integer from 0 to 360 that represents the hue of the color.
satA double from 0.0 to 1.0 that represents the saturation of the color.
valueA double from 0.0 to 1.0 that represents the brightness of the color.

◆ web()

color& vex::color::web ( const char *  color)

Creates a color using a hexadecimal value.

Returns
Returns a reference to a color.
Parameters
colorA hexadecimal or web color value that defines a specific color.

Member Data Documentation

◆ black

const color vex::color::black
static

Represents the color black.

Returns
Returns the color black

◆ white

const color vex::color::white
static

Represents the color white.

Returns
Returns the color white

◆ red

const color vex::color::red
static

Represents the color red.

Returns
Returns the color red

◆ green

const color vex::color::green
static

Represents the color green.

Returns
Returns the color green

◆ blue

const color vex::color::blue
static

Represents the color blue.

Returns
Returns the color blue

◆ yellow

const color vex::color::yellow
static

Represents the color yellow.

Returns
Returns the color yellow

◆ orange

const color vex::color::orange
static

Represents the color orange.

Returns
Returns the color orange

◆ purple

const color vex::color::purple
static

Represents the color purple.

Returns
Returns the color purple

◆ cyan

const color vex::color::cyan
static

Represents the color cyan.

Returns
Returns the color cyan

◆ transparent

const color vex::color::transparent
static

Represents the color transparent.

Returns
Returns the color transparent