Class: Color::Palette::AdobeColor

Class | Color::Palette::AdobeColor
In: | lib/color/palette/adobecolor.rb
Parent: | Object

A class that can read an Adobe Color palette file (used for Photoshop swatches) and provide a Hash-like interface to the contents. Not all colour formats in ACO files are supported. Based largely off the information found by Larry Tesler.

Not all Adobe Color files have named colours; all named entries are returned as an array.

      pal = Color::Palette::AdobeColor.from_file(my_aco_palette)
      pal[0]          => Color::RGB<...>
      pal["white"]    => [ Color::RGB<...> ]
      pal["unknown"]  => [ Color::RGB<...>, Color::RGB<...>, ... ]

AdobeColor palettes are always indexable by insertion order (an integer key).

Version 2 palettes use UTF-16 colour names.

### Methods

[] each each_name from_file from_io new size values_at

### Included Modules

Enumerable

### Attributes

lost | [R] | Contains the "lost" colours in the palette. These colours could not be properly loaded (e.g., L*a*b* is not supported by Color, so it is "lost") or are not understood by the algorithms.
statistics | [R] | Returns statistics about the nature of the colours loaded.
version | [R] |

### Public Class methods

from_file(filename)

Create an AdobeColor palette object from the named file.

from_io(io)

Create an AdobeColor palette object from the provided IO.

new(palette)

Create a new AdobeColor palette from the palette file as a string.

### Public Instance methods

[](key)

If a Numeric `key` is provided, the single colour value at that position will be returned. If a String `key` is provided, the colour set (an array) for that colour name will be returned.

each() {|el| ...}

Loops through each colour.

each_name( {|color_name, color_set| ...}

Loops through each named colour set.

size()
values_at(*selectors)

Provides the colour or colours at the provided selectors.

[Validate]