class Term::ANSIColor::Attribute
def initialize(name, code, options = {})
def initialize(name, code, options = {}) @name = name.to_sym @background = !!options[:background] @code = code.to_s @direct = false @true_color = false if rgb = options[:true_color] @true_color = true @rgb = rgb elsif rgb = options[:direct] @direct = true @rgb = RGBTriple.from_html(rgb) elsif html = options[:html] @rgb = RGBTriple.from_html(html) elsif options.slice(:red, :green, :blue).size == 3 @rgb = RGBTriple.from_hash(options) else @rgb = nil # prevent instance variable not initialized warnings end end