libvisual
0.5.0
|
Colour palette class for indexed colour modes. More...
#include <libvisual/lv_palette.h>
Public Member Functions | |
Palette ()=default | |
Creates a new Palette object. | |
Palette (unsigned int ncolors) | |
Palette (Palette const &)=default | |
Palette (Palette &&palette) | |
Palette & | operator= (Palette const &rhs)=default |
Palette & | operator= (Palette &&rhs) |
bool | empty () const |
unsigned int | size () const |
void | blend (Palette const &src1, Palette const &src2, float rate) |
This function is capable of morphing from one palette to another. More... | |
void | allocate_colors (unsigned int size) |
Allocate an amount of colors for a VisPalette. More... | |
Color | color_cycle (float rate) |
Can be used to cycle through the colors of a VisPalette and blend between elements. More... | |
int | find_color (Color const &color) const |
Public Attributes | |
std::vector< Color > | colors |
Colour palette class for indexed colour modes.
Definition at line 46 of file lv_palette.h.
void LV::Palette::allocate_colors | ( | unsigned int | size | ) |
Allocate an amount of colors for a VisPalette.
size | Number of colors to allocate |
Definition at line 41 of file lv_palette.cpp.
This function is capable of morphing from one palette to another.
src1 | Pointer to a VisPalette that acts as the first source for the morph. |
src2 | Pointer to a VisPalette that acts as the second source for the morph. |
rate | Value that sets the rate of the morph, which is valid between 0 and 1. |
Definition at line 46 of file lv_palette.cpp.
VisColor LV::Palette::color_cycle | ( | float | rate | ) |
Can be used to cycle through the colors of a VisPalette and blend between elements.
The rate is from 0.0 to number of VisColors in the VisPalette. The VisColor is newly allocated so you have to unref it. The last VisColor in the VisPalette is morphed with the first.
rate | Selection of the VisColor from the VisPalette, goes from 0.0 to number of VisColors in the VisPalette and morphs between colors if needed. |
Definition at line 58 of file lv_palette.cpp.