asciinema.org/app/presenters/brush_presenter.rb

35 lines
479 B
Ruby
Raw Normal View History

class BrushPresenter < SimpleDelegator
def to_css_class
if default?
nil
else
2013-08-25 14:34:02 +00:00
classes = [fg_class, bg_class, bold_class, underline_class, inverse_class]
classes.compact.join(' ')
end
end
private
def fg_class
"fg#{fg}" if fg
end
def bg_class
"bg#{bg}" if bg
end
def bold_class
'bright' if bold?
end
def underline_class
'underline' if underline?
end
def inverse_class
'inverse' if inverse?
end
end