|
Marbellous
Marbellous, a WebApp to generate paper marbling patterns.
|
Contains a vector of colors. More...
#include <Palette.hpp>

Public Member Functions | |
| Palette () | |
| Construct a new Palette object. More... | |
| Palette (size_t colors) | |
Construct a new Palette object with colors colors. More... | |
| size_t | add (Color const col) |
| Add a color to the palette. More... | |
| size_t | getSize () const |
| Get the palette's size. More... | |
| Color & | operator[] (size_t const index) |
Get or set the color at index. More... | |
| const Color & | operator[] (size_t const index) const |
Get the color at index. More... | |
| unsigned | getRandomColorId () const |
| Returns a random color of that pallet based on the ratios. More... | |
| void | setRatioAt (size_t index, unsigned ratio) |
Set the ratio of the color at index. More... | |
| void | setColorAt (size_t index, const Color &color) |
| set new color and update ratios More... | |
| std::vector< Color >::const_iterator | begin () const |
| std::vector< Color >::const_iterator | end () const |
Contains a vector of colors.
| Palette::Palette | ( | ) |
Construct a new Palette object.
| Palette::Palette | ( | size_t | colors | ) |
Construct a new Palette object with colors colors.
| colors | Number of colors to pre allocate. |
| size_t Palette::add | ( | Color const | col | ) |
|
inline |
|
inline |
| unsigned Palette::getRandomColorId | ( | ) | const |
Returns a random color of that pallet based on the ratios.

| size_t Palette::getSize | ( | ) | const |
Get the palette's size.

| Color & Palette::operator[] | ( | size_t const | index | ) |
Get or set the color at index.
| index | Color to change. |
index. get or set the color at index, might throw std::out_of_range | const Color & Palette::operator[] | ( | size_t const | index | ) | const |
Get the color at index.
| index | Color to get. |
index. | void Palette::setColorAt | ( | size_t | index, |
| const Color & | color | ||
| ) |
set new color and update ratios

| void Palette::setRatioAt | ( | size_t | index, |
| unsigned | ratio | ||
| ) |
Set the ratio of the color at index.
| index | ID of color to change the ratio for. |
| ratio | New ratio. updates a ratio |
