class AsciiMath::AST::Color

Attributes

text[R]

Public Class Methods

new(r, g, b, text) click to toggle source
Calls superclass method AsciiMath::AST::ValueNode::new
# File lib/asciimath/ast.rb, line 367
def initialize(r, g, b, text)
  super({:r => r, :g => g, :b => b}.freeze)
  @text = text.dup.freeze
end

Public Instance Methods

==(o) click to toggle source
# File lib/asciimath/ast.rb, line 384
def ==(o)
  o.class == self.class &&
      o.red == red &&
      o.green == green &&
      o.blue == blue &&
      o.text == text
end
blue() click to toggle source
# File lib/asciimath/ast.rb, line 380
def blue
  value[:b]
end
green() click to toggle source
# File lib/asciimath/ast.rb, line 376
def green
  value[:g]
end
red() click to toggle source
# File lib/asciimath/ast.rb, line 372
def red
  value[:r]
end
to_hex_rgb() click to toggle source
# File lib/asciimath/ast.rb, line 392
def to_hex_rgb
  sprintf('#%02x%02x%02x', red, green, blue)
end
to_s() click to toggle source
# File lib/asciimath/ast.rb, line 396
def to_s
  text
end