# synfig::Palette Class Reference

`#include <palette.h>`

List of all members.

## Public Member Functions

| Palette ()
| Palette (const String &name_)
| Palette (const Surface &surface, int size=256)
iterator | find_closest (const Color &color, float *dist=0)
const_iterator | find_closest (const Color &color, float *dist=0) const
iterator | find_heavy ()
iterator | find_light ()
void | save_to_file (const synfig::String &filename) const

## Static Public Member Functions

static Palette | grayscale (int steps=16)
static Palette | load_from_file (const synfig::String &filename)

## Constructor & Destructor Documentation

Palette::Palette | ( |  | ) |

Palette::Palette | ( | const String & | name_ | ) |

Palette::Palette | ( | const Surface & | surface,
|  | int | size = `256` |
| ) |  |  |

Generates a palette for the given surface

References synfig::Color::black(), find_closest(), synfig::Color::get_a(), and synfig::Color::white().

## Member Function Documentation

Palette::iterator Palette::find_closest | ( | const Color & | color,
|  | float * | dist = `0` |
| ) |  |  |

References f, synfig::Color::get_a(), synfig::Color::get_u(), synfig::Color::get_v(), and synfig::Color::get_y().

Referenced by gif::end_frame(), find_closest(), and Palette().

Palette::const_iterator Palette::find_closest | ( | const Color & | color,
|  | float * | dist = `0` |
| ) |  |  | const

References find_closest().

Palette::iterator Palette::find_heavy | ( |  | ) |

Palette::iterator Palette::find_light | ( |  | ) |

Palette Palette::grayscale | ( | int | steps = `16` | ) | `[static]`

References _, and f.

void Palette::save_to_file | ( | const synfig::String & | filename | ) | const

References _, and PALETTE_FILE_COOKIE.

Palette Palette::load_from_file | ( | const synfig::String & | filename | ) | `[static]`

References _, synfig::PaletteItem::color, synfig::PaletteItem::name, PALETTE_FILE_COOKIE, synfig::Color::set_a(), synfig::Color::set_b(), synfig::Color::set_g(), and synfig::Color::set_r().

The documentation for this class was generated from the following files:

- palette.h
- palette.cpp