class Oho::T416ColorEscapeCode
- Oho::T416ColorEscapeCode
- Oho::EscapeCode
- Reference
- Object
Defined in:
oho/t_416_color_escape_code.crConstant Summary
-
BASIC_FOREGROUND_COLOR_LOOKUP =
{30 => "dimgray", 31 => "red", 32 => "lime", 33 => "yellow", 34 => "#3333FF", 35 => "fuchsia", 36 => "aqua", 37 => "white"}
-
CONTENT_COLOR_TABLE_LOOKUP =
{1 => 30, 2 => 31, 3 => 32, 4 => 33, 5 => 34, 6 => 35, 7 => 36, 0 => 37}
-
FOREGROUND_COLOR_INTS =
BASIC_FOREGROUND_COLOR_LOOKUP.keys
Constructors
Instance Method Summary
- #affects_display? : Bool
- #background_color : String?
- #convert_cmy_to_rgb(cyan : Int32, magenta : Int32, yellow : Int32) : Tuple(Int32, Int32, Int32)
- #foreground_color : String?
-
#generate_background_string(escape_code : EscapeCode | Nil) : String
TODO refactor this into EscapeCode
- #raw : String
- #string : String
- #styles : Array(Int32)
-
#to_span(escape_code : EscapeCode | Nil) : String
we take in the last escap_code in part to know we have to end the prior code and in part to know what needs to be continued if it is ended.
Instance methods inherited from class Oho::EscapeCode
affects_display? : Bool
affects_display?,
raw : String
raw,
styles : Array(Int32)
styles,
to_span(escape_code : EscapeCode | Nil) : String
to_span
Constructor methods inherited from class Oho::EscapeCode
new(string : String, options : Hash(Symbol, String))
new
Constructor Detail
Instance Method Detail
def convert_cmy_to_rgb(cyan : Int32, magenta : Int32, yellow : Int32) : Tuple(Int32, Int32, Int32)
#
def generate_background_string(escape_code : EscapeCode | Nil) : String
#
TODO refactor this into EscapeCode
def to_span(escape_code : EscapeCode | Nil) : String
#
we take in the last escap_code in part to know we have to end the prior code and in part to know what needs to be continued if it is ended. if we we to simply nest them and tack a pile of end spans at the end of the document we'd give the headaches to the browser and anyone reading the source. Headaches are bad.