class Rouge::TexThemeRenderer

def inline_name(color)

def inline_name(color)
  color =~ /^#(\h+)/ or return nil
  # xcolor does not support 3-character HTML colors,
  # so we convert them here
  case $1.size
  when 6
    $1
  when 3
    # duplicate every character: abc -> aabbcc
    $1.gsub(/\h/, '\0\0')
  else
    raise "invalid HTML color: #{$1}"
  end.upcase
end