Class Color

Class Documentation

class nyx::Color

Color is used for any function that requires a color. There are two ways to construct a color, with integer values given for the r, g, b, and a channels, or a hex number which must include an alpha channel as the final part of the number.

Public Functions

Color(unsigned int hex)

Instantiate a Color using a hex value

Parameters
  • hex: integer of the form 0xRRGGBBAA

Color(int r, int g, int b, int a = 255)

Instantiate a Color using 3-4 integer values

Parameters
  • r: the red channel, [0, 255]

  • g: the green channel, [0, 255]

  • b: the blue channel, [0, 255]

  • a: the alpha channel, [0, 255]

Public Members

int r

the red channel, [0, 255]

int g

the green channel, [0, 255]

int b

the blue channel, [0, 255]

int a

the alpha channel, [0, 255]

float rf

the red channel, [0.0f, 1.0f]

float gf

the green channel, [0.0f, 1.0f]

float bf

the blue channel, [0.0f, 1.0f]

float af

the alpha channel, [0.0f, 1.0f]