struct

Termbox::Color

Inherits Termbox::IColor / Struct / Value / Object

Translates any RGB color between terminal ouput modes (see OutputMode).

Constants

Black = Color.new(*M8_COLORS[0])
Default = DefaultColor.new
Green = Color.new(*M8_COLORS[2])
Maroon = Color.new(*M8_COLORS[1])
Navy = Color.new(*M8_COLORS[4])
Olive = Color.new(*M8_COLORS[3])
Purple = Color.new(*M8_COLORS[5])
Silver = Color.new(*M8_COLORS[7])
Teal = Color.new(*M8_COLORS[6])
White = Color.new(255, 255, 255)

Constructors

new(r : Int32, g : Int32, b : Int32, also : Termbox::Color::Also = Also::None)
Source

Class methods

[](r, g, b)

Shorthand for new.

Source
[](*, h, s, l)

Shorthand for new but converts the given HSL to RGB first.

Source

Instance methods

|(also also_ : Color::Also)

Mixes also, an output-mode-independent attribute, into this color.

Source
also

Returns this color's attribute.

b
clone
Source
copy_with(r _r = @r, g _g = @g, b _b = @b, also _also = @also)
Source
g
m256

Returns M256 color (0-255) closest to this RGB color.

Source
normal

Returns normal color (0-8) closest to this RGB color.

Source
r
truecolor

Returns true color for this RGB color.

Source

Nested types