A class that can read a GIMP (GNU Image Manipulation Program) palette file and provide a Hash-like interface to the contents. GIMP colour palettes are RGB values only.
Because two or more entries in a GIMP palette may have the same name, all named entries are returned as an array.
pal = Color::Palette::Gimp.from_file(my_gimp_palette) pal[0] => Color::RGB<...> pal["white"] => [ Color::RGB<...> ] pal["unknown"] => [ Color::RGB<...>, Color::RGB<...>, ... ]
GIMP Palettes are always indexable by insertion order (an integer key).
| Public Attributes | |
|---|---|
| name | |
| Public Methods | |
|---|---|
| [] | |
| each | Loops through each colour. |
| each_ |
Loops through each named colour set. |
| from_ |
Create a GIMP palette object from the named file. |
| from_ |
Create a GIMP palette object from the provided IO. |
| new | Create a new GIMP palette. |
| valid? | Returns true if this is believed to be a valid GIMP palette. |
<code/>and<pre/>for code samples.