Console::Palette

console 0.2.0 · app/console/palette.rb · 75 lines · view source

Also defined here: Console::Style

Console::Palette -- named colors and a tiny style table.

Every draw helper defaults its colors from this table, so a cart can restyle the whole console by assigning to Palette instead of touching call sites.

def to_hash(color, alpha = nil)

Resolve a color given as a symbol, [r,g,b], [r,g,b,a], or {r:,g:,b:,a:}. Returns a hash ready to merge into a primitive.

def to_a(color)

Convenience for the common "give me an rgba triplet" case.

def get(key)
line 71