ManaPlus
Public Member Functions | Data Fields
DyeColor Struct Reference

#include <dyecolor.h>

Public Member Functions

 DyeColor ()
 
 DyeColor (const uint8_t r, const uint8_t g, const uint8_t b)
 
 DyeColor (const uint8_t r, const uint8_t g, const uint8_t b, const uint8_t a)
 
void update ()
 

Data Fields

union {
   uint8_t   value [4]
 
   uint32_t   valueAOgl
 
}; 
 
uint32_t valueA
 
uint32_t valueS
 
uint32_t valueSOgl
 

Detailed Description

Definition at line 29 of file dyecolor.h.

Constructor & Destructor Documentation

◆ DyeColor() [1/3]

DyeColor::DyeColor ( )
inline

Definition at line 31 of file dyecolor.h.

31  :
32  valueA(buildHex(0, 0, 0, 255)),
33  valueS(buildHex(0, 0, 0, 0)),
34  valueSOgl(buildHexOgl(0, 0, 0, 0))
35  {
36  value[3] = 255;
37  }
#define buildHex(a, b, c, d)
Definition: buildhex.h:42
#define buildHexOgl(a, b, c, d)
Definition: buildhex.h:46
uint32_t valueSOgl
Definition: dyecolor.h:82
uint8_t value[4]
Definition: dyecolor.h:77
uint32_t valueS
Definition: dyecolor.h:81
uint32_t valueA
Definition: dyecolor.h:80

References value.

◆ DyeColor() [2/3]

DyeColor::DyeColor ( const uint8_t  r,
const uint8_t  g,
const uint8_t  b 
)
inline

Definition at line 39 of file dyecolor.h.

41  :
42  valueA(buildHex(r, g, b, 255)),
43  valueS(buildHex(r, g, b, 0)),
44  valueSOgl(buildHexOgl(0, b, g, r))
45  {
46  value[0] = r;
47  value[1] = g;
48  value[2] = b;
49  value[3] = 255;
50  }

References value.

◆ DyeColor() [3/3]

DyeColor::DyeColor ( const uint8_t  r,
const uint8_t  g,
const uint8_t  b,
const uint8_t  a 
)
inline

Definition at line 52 of file dyecolor.h.

55  :
56  valueA(buildHex(r, g, b, a)),
57  valueS(buildHex(r, g, b, 0)),
58  valueSOgl(buildHexOgl(0, b, g, r))
59  {
60  value[0] = r;
61  value[1] = g;
62  value[2] = b;
63  value[3] = a;
64  }

References value.

Member Function Documentation

◆ update()

void DyeColor::update ( )
inline

Definition at line 68 of file dyecolor.h.

69  {
70  valueA = buildHex(value[0], value[1], value[2], value[3]);
71  valueS = buildHex(value[0], value[1], value[2], 0);
72  valueSOgl = buildHexOgl(0, value[2], value[1], value[0]);
73  }

References buildHex, buildHexOgl, value, valueA, valueS, and valueSOgl.

Field Documentation

◆ 

union { ... }

◆ value

uint8_t DyeColor::value[4]

◆ valueA

uint32_t DyeColor::valueA

Definition at line 80 of file dyecolor.h.

Referenced by update().

◆ valueAOgl

uint32_t DyeColor::valueAOgl

Definition at line 78 of file dyecolor.h.

◆ valueS

uint32_t DyeColor::valueS

Definition at line 81 of file dyecolor.h.

Referenced by update().

◆ valueSOgl

uint32_t DyeColor::valueSOgl

Definition at line 82 of file dyecolor.h.

Referenced by update().


The documentation for this struct was generated from the following file: