Kaim::Color Class Reference

#include <color.h>

Class Description

RGBA color.

+ Examples:

Public Member Functions

 Color ()
 opaque black More...
 
 Color (KyUInt32 rgba)
 w parameters in [0, 255] a=0 is fully transparent, a=255 is opaque More...
 
bool IsVisible () const
 alpha != 0 More...
 
bool IsOpaque () const
 alpha == 255 More...
 
bool IsTransparent () const
 alpha != 255 More...
 
void SetFloat (KyFloat32 r_, KyFloat32 g_, KyFloat32 b_, KyFloat32 a_=1.0f)
 parameters in [0.0f, 1.0f], a=0.0f is fully transparent, a=1.0f is fully opaque More...
 

Static Public Member Functions

static Color GetDistinctColor (KyUInt32 index)
 Retrieves the color with the specified index within a limited internal palette of 31 distinct colors. More...
 
static Color GetDistinctColor (const KyUInt32 index, const Color *customPalette, KyUInt32 nbColorsInPalette)
 Retrieves the color with the specified index from the specified palette. More...
 

Public Attributes

KyUInt8 r
 red More...
 
KyUInt8 g
 green More...
 
KyUInt8 b
 blue More...
 
KyUInt8 a
 alpha More...
 

Constructor & Destructor Documentation

Kaim::Color::Color ( )
inline

opaque black

Kaim::Color::Color ( KyUInt32  rgba)
inline

w parameters in [0, 255] a=0 is fully transparent, a=255 is opaque

Member Function Documentation

Color Kaim::Color::GetDistinctColor ( KyUInt32  index)
static

Retrieves the color with the specified index within a limited internal palette of 31 distinct colors.

Color Kaim::Color::GetDistinctColor ( const KyUInt32  index,
const Color customPalette,
KyUInt32  nbColorsInPalette 
)
static

Retrieves the color with the specified index from the specified palette.

Parameters
indexThe index of the color to retrieve.
customPaletteAn array of colors from which the specified index will be retrieved.
nbColorsInPaletteThe number of elements in thecustomPalette array.
bool Kaim::Color::IsOpaque ( ) const
inline

alpha == 255

bool Kaim::Color::IsTransparent ( ) const
inline

alpha != 255

bool Kaim::Color::IsVisible ( ) const
inline

alpha != 0

void Kaim::Color::SetFloat ( KyFloat32  r_,
KyFloat32  g_,
KyFloat32  b_,
KyFloat32  a_ = 1.0f 
)
inline

parameters in [0.0f, 1.0f], a=0.0f is fully transparent, a=1.0f is fully opaque

Member Data Documentation

KyUInt8 Kaim::Color::a

alpha

KyUInt8 Kaim::Color::b

blue

KyUInt8 Kaim::Color::g

green

KyUInt8 Kaim::Color::r

red


The documentation for this class was generated from the following files:
  • gwnavruntime/visualsystem/color.h
  • gwnavruntime/visualsystem/color.cpp