Sha256: fc47f9c5ff4d9b38662e42f3daab5fdf2094ee666403cdb003c89cbaff753d53

Contents?: true

Size: 681 Bytes

Versions: 10

Compression:

Stored size: 681 Bytes

Contents

require 'term/ansicolor'

module Weskit::WML::Formatters
  module AnsiColor
    module_function

    private

    def ac
      Term::ANSIColor
    end

    def reset
      ac.reset
    end

    def attribute text
      "#{attribute_color}#{text}#{reset}"
    end

    def attribute_color
      ac.yellow
    end

    def val text
      "#{value_color}#{text}#{reset}"
    end

    def val_color
      ac.intense_cyan
    end

    def control text
      "#{control_color}#{text}#{reset}"
    end

    def control_color
      ac.intense_blue
    end

    def element text
      "#{element_color}#{text}#{reset}"
    end

    def element_color
      ac.intense_green
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
weskit-0.3.6 lib/weskit/wml/formatters/ansi_color.rb
weskit-0.3.5 lib/weskit/wml/formatters/ansi_color.rb
weskit-0.3.4 lib/weskit/wml/formatters/ansi_color.rb
weskit-0.3.3 lib/weskit/wml/formatters/ansi_color.rb
weskit-0.3.2 lib/weskit/wml/formatters/ansi_color.rb
weskit-0.3.1 lib/weskit/wml/formatters/ansi_color.rb
weskit-0.3.0 lib/weskit/wml/formatters/ansi_color.rb
weskit-0.2.1 lib/weskit/wml/formatters/ansi_color.rb
weskit-0.2.0 lib/weskit/wml/formatters/ansi_color.rb
weskit-0.1.0 lib/weskit/wml/formatters/ansi_color.rb