Class

Gimp

Extends:

Includes:

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_name Loops through each named colour set.
from_file Create a GIMP palette object from the named file.
from_io 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.
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.