# File lib/ansi/code.rb, line 326
    def hex_code(string, background=false)
      string.tr!('#','')
      x = (string.size == 6 ? 2 : 1)
      r, g, b = [0,1,2].map{ |i| string[i*x,2].to_i(16) }
      rgb_code(r, g, b, background)
    end