Class ColorGradient

Class Documentation

class ColorGradient

Public Types

enum GradientType

Identifies a color gradient.

Values:

enumerator SOLID
enumerator GREY
enumerator HSV
enumerator JET
enumerator HOT
enumerator SHSV
enumerator SIMPSONS
enumerator WHITE
enumerator BLACK
enumerator DEFAULT

Public Functions

inline ColorGradient(size_t buckets = 256)

Constructs a color gradient with the given number of buckets.

Parameters:

buckets – Number of colors in current gradient. Default is 256.

virtual ~ColorGradient() = default

Destructor.

void getColor(RGBFColor &color, size_t bucket, GradientType gradient = ColorGradient::GREY) const

Returns three float values to represent the color of the given bucket.

Parameters:
  • color – The three color components

  • bucket – The bucket index

  • gradient – The type of gradient (default grey)

void getColor(RGB8Color &color, size_t bucket, GradientType gradient = ColorGradient::GREY) const

Returns three uint8_t values to represent the color of the given bucket.

Parameters:
  • color – The three color components

  • bucket – The bucket index

  • gradient – The type of gradient (default grey)

Public Static Functions

static GradientType gradientFromString(const std::string &string)

Gets a gradient type from given string.