class

PointClickEngine::Graphics::Utils::Palette

Inherits Reference < Object

Color palette for retro-style graphics

Constructors

new(name : String)
Source

Instance methods

[](index : Int32) : RL::Color | Nil

Get color by index

Source
[](name : String) : RL::Color | Nil

Get color by name

Source
add_color(name : String, color : RL::Color) : Int32

Add a color to the palette

Source
add_hex(name : String, hex : String) : Int32 | Nil

Add color from hex string

Source
clone

Clone palette

Source
color_map
Source
color_map=(color_map : Hash(String, Int32))
Source
colors
Source
colors=(colors : Array(Entry))
Source
each

Iterate over colors

Source
find_closest(color : RL::Color) : Int32

Find closest color in palette

Source
gradient(from_name : String, to_name : String, steps : Int32) : Array(RL::Color) | Nil

Create gradient between two palette colors

Source
index_of(name : String) : Int32 | Nil

Get color index by name

Source
name
Source
name=(name : String)
Source
remap_image(image : RL::Image) : RL::Image

Map image to palette colors

Source
size

Size of palette

Source
to_a

Export to array

Source

Nested types