struct Termbox::Color
- Termbox::Color
- Termbox::IColor
- Struct
- Value
- Object
Overview
Translates any RGB color between terminal ouput modes
(see OutputMode
).
Defined in:
termbox2/color.crConstant Summary
-
Black =
Color.new(*M8_COLORS[0])
-
Default =
DefaultColor.new
-
Green =
Color.new(*M8_COLORS[2])
-
M8_COLORS =
{ {0, 0, 0}, {128, 0, 0}, {0, 128, 0}, {128, 128, 0}, {0, 0, 128}, {128, 0, 128}, {0, 128, 128}, {192, 192, 192}, {128, 128, 128} }
-
RGBs of Mode::M8 colors.
-
Maroon =
Color.new(*M8_COLORS[1])
-
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
Class Method Summary
-
.[](r, g, b)
Shorthand for
.new
. -
.[](*, h, s, l)
Shorthand for
.new
but converts the given HSL to RGB first.
Instance Method Summary
-
#|(also also_ : Color::Also)
Mixes also, an output-mode-independent attribute, into this color.
-
#also : Termbox::Color::Also
Returns this color's attribute.
- #b : Int32
- #clone
- #copy_with(r _r = @r, g _g = @g, b _b = @b, also _also = @also)
- #g : Int32
-
#m256
Returns M256 color (0-255) closest to this RGB color.
-
#normal
Returns normal color (0-8) closest to this RGB color.
- #r : Int32
-
#truecolor
Returns true color for this RGB color.
Instance methods inherited from struct Termbox::IColor
|(also also_ : Color::Also)
|,
also
also,
for(mode : OutputMode) : UInt32
for,
initialize
initialize
Constructor methods inherited from struct Termbox::IColor
new
new
Constructor Detail
Class Method Detail
Instance Method Detail
def |(also also_ : Color::Also)
#
Mixes also, an output-mode-independent attribute, into this color.
def also : Termbox::Color::Also
#
Description copied from struct Termbox::IColor
Returns this color's attribute.