Class Rubygame::Color::Palette
In: lib/rubygame/color/palettes/palette.rb
lib/rubygame/color/palettes/palette.rb
Parent: Object

Methods

[]   []   []=   []=   include   include   new   new   uninclude   uninclude  

Public Class methods

Create a new Palette with the given name => color pairs.

Create a new Palette with the given name => color pairs.

Public Instance methods

Retrieve a color by name from this palette.

The name can be a Symbol or String. See sanitize_name.

If the color cannot be found in this palette, search each of the included palettes (recursively, depth-first, to a maximum depth of 5 levels).

If the color is not found in this palette or any included palettes, raise IndexError.

Retrieve a color by name from this palette.

The name can be a Symbol or String. See sanitize_name.

If the color cannot be found in this palette, search each of the included palettes (recursively, depth-first, to a maximum depth of 5 levels).

If the color is not found in this palette or any included palettes, raise IndexError.

Store a color by name in this palette. See sanitize_name

Store a color by name in this palette. See sanitize_name

Include another palette in this one. If a color cannot be found in this palette, the included palette(s) will be searched. See also uninclude.

Has no effect if the palette is already included.

Include another palette in this one. If a color cannot be found in this palette, the included palette(s) will be searched. See also uninclude.

Has no effect if the palette is already included.

Remove the other palette from this one, so that it won‘t be searched for missing colors anymore. Has no effect if the other palette hasn‘t been included.

Remove the other palette from this one, so that it won‘t be searched for missing colors anymore. Has no effect if the other palette hasn‘t been included.

[Validate]