Generated by Doxygen 1.8.14
Neographics
Color

Classes

union  n_GColor8
 

Modules

 Definitions
 

Macros

#define n_GColorFromRGBA(_r, _g, _b, _a)
 
#define n_GColorFromRGB(_r, _g, _b)
 
#define n_GColorFromHEX(_h)
 

Typedefs

typedef union n_GColor8 n_GColor8
 
typedef n_GColor8 n_GColor
 

Functions

bool n_gcolor_equal (n_GColor8 a, n_GColor8 b)
 
n_GColor8 n_gcolor_legible_over (n_GColor8 color)
 

Detailed Description

Color-handling code.

Macro Definition Documentation

◆ n_GColorFromHEX

#define n_GColorFromHEX (   _h)
Value:
n_GColorFromRGB(((_h) >> 16) & 0b11111111, \
((_h) >> 8) & 0b11111111, \
(_h) & 0b11111111)
#define n_GColorFromRGB(_r, _g, _b)
Definition: color.h:63

Convenience macro to create the closest n_GColor to a hex value (eg 0xFF7700).

◆ n_GColorFromRGB

#define n_GColorFromRGB (   _r,
  _g,
  _b 
)
Value:
((n_GColor8) {{.a = 0b11, .r = ((_r) >> 6) & 0b11,\
.g = ((_g) >> 6) & 0b11, .b = ((_b) >> 6) & 0b11}})
union n_GColor8 n_GColor8

Convenience macro to create the closest n_GColor to 3 8-bit values.

◆ n_GColorFromRGBA

#define n_GColorFromRGBA (   _r,
  _g,
  _b,
  _a 
)
Value:
((n_GColor8) {{.a = ((_a) >> 6) & 0b11, .r = ((_r) >> 6) & 0b11,\
.g = ((_g) >> 6) & 0b11, .b = ((_b) >> 6) & 0b11}})
union n_GColor8 n_GColor8

Convenience macro to create the closest n_GColor to 4 8-bit values.

Typedef Documentation

◆ n_GColor8

typedef union n_GColor8 n_GColor8

Internal representation of colors: now with revolutionary 2-bit-per-channel technology!

Function Documentation

◆ n_gcolor_equal()

bool n_gcolor_equal ( n_GColor8  a,
n_GColor8  b 
)
inline

Check for the equality of two n_GColor(s).

◆ n_gcolor_legible_over()

n_GColor8 n_gcolor_legible_over ( n_GColor8  color)
inline

Get the ideal text n_GColor over a given background.