List of all members
rgb_color Struct Reference

Structure representing a 32 bit RGBA color. More...

RGB Colors

uint8 red
 Red value for the color. More...
 
uint8 green
 Green value for the color. More...
 
uint8 blue
 Blue value for the color. More...
 
uint8 alpha
 Alpha value for the color. More...
 
rgb_colorset_to (uint8 r, uint8 g, uint8 b, uint8 a=255)
 Helper method to set all values of the color. More...
 
int32 Brightness () const
 Calculates a value representing the brightness of this color. More...
 
bool operator== (const rgb_color &other) const
 Comparison operator. More...
 
bool operator!= (const rgb_color &other) const
 Comparison operator. More...
 
rgb_coloroperator= (const rgb_color &other)
 Assign values from another color object. More...
 

Detailed Description

Structure representing a 32 bit RGBA color.

Since
BeOS R3

Member Function Documentation

◆ Brightness()

int32 rgb_color::Brightness ( ) const

Calculates a value representing the brightness of this color.

This method uses a fast algorithm to calculate the brightness in Luma of the color.

Returns
A value representing the brightness.
Since
Haiku R1

◆ operator!=()

bool rgb_color::operator!= ( const rgb_color other) const
inline

Comparison operator.

Parameters
otherThe other color to compare to.
Return values
trueThe colors are different.
falseThe colors match.
Since
Haiku R1

◆ operator=()

rgb_color & rgb_color::operator= ( const rgb_color other)
inline

Assign values from another color object.

Parameters
otherThe other color to copy.
Returns
A reference to this object.
Since
Haiku R1

References alpha, blue, green, red, and set_to().

◆ operator==()

bool rgb_color::operator== ( const rgb_color other) const
inline

Comparison operator.

Parameters
otherThe other color to compare to.
Return values
trueThe colors match.
falseThe colors are different.
Since
Haiku R1

◆ set_to()

rgb_color & rgb_color::set_to ( uint8  r,
uint8  g,
uint8  b,
uint8  a = 255 
)
inline

Helper method to set all values of the color.

Parameters
rRed value.
gGreen value.
bBlue value.
aAlpha value.
Returns
A reference to this object.
Since
Haiku R1

References alpha, blue, green, and red.

Referenced by operator=().

Member Data Documentation

◆ alpha

uint8 rgb_color::alpha

Alpha value for the color.

Since
BeOS R3

Referenced by BScreen::IndexForColor(), operator=(), set_to(), BView::SetHighColor(), BView::SetLowColor(), and BView::SetViewColor().

◆ blue

uint8 rgb_color::blue

◆ green

uint8 rgb_color::green

◆ red

uint8 rgb_color::red