You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
asciinema.org/app/assets/javascripts/player/brush.js.coffee

24 lines
464 B
CoffeeScript

13 years ago
class AsciiIo.Brush
@cache: {}
@clearCache: ->
@cache = {}
@create: (options) ->
options ||= {}
key = "#{options.fg}_#{options.bg}_#{options.bright}_#{options.underline}"
brush = @cache[key]
if not brush
brush = new AsciiIo.Brush(options)
@cache[key] = brush
brush
constructor: (options) ->
@fg = options.fg
@bg = options.bg
@bright = options.bright
@underline = options.underline