Module: TTYHue

Defined in:
lib/ttyhue.rb,
lib/ttyhue/parser.rb,
lib/ttyhue/preview.rb,
lib/ttyhue/version.rb,
lib/ttyhue/colorizer.rb,
lib/ttyhue/parser/tag.rb,
lib/ttyhue/term_color.rb,
lib/ttyhue/parser/color_tag.rb,
lib/ttyhue/parser/style_tag.rb,
lib/ttyhue/parser/color_stack.rb

Defined Under Namespace

Classes: Colorizer, Parser, Preview, TermColor

Constant Summary collapse

VERSION =
"0.1.2"

Class Method Summary collapse

Class Method Details

.c(str, styles = {}) ⇒ Object



20
21
22
# File 'lib/ttyhue.rb', line 20

def self.c(str, styles = {})
  TTYHue::Colorizer.colorize(str, styles)
end

.global_styleObject



8
9
10
11
12
13
14
# File 'lib/ttyhue.rb', line 8

def self.global_style
  begin
    @@styles.to_h
  rescue NameError
    {}
  end
end

.preview_guicolorsObject



28
29
30
# File 'lib/ttyhue.rb', line 28

def self.preview_guicolors
  Preview.preview_guicolors
end

.preview_termcolorsObject



24
25
26
# File 'lib/ttyhue.rb', line 24

def self.preview_termcolors
  Preview.preview_termcolors
end

.set_style(hash) ⇒ Object



16
17
18
# File 'lib/ttyhue.rb', line 16

def self.set_style(hash)
  @@styles = hash.to_h
end