def hex_to_f(h)
      h = (h[1..-1]).chars.each_slice(2).map(&:join)
      a = []

      h.each do |el|
        a.push(el.to_i(16))
      end

      a.push(255)
      return to_f(a)
    end
def hex_to_f(h)
      h = (h[1..-1]).chars.each_slice(2).map(&:join)
      a = []

      h.each do |el|
        a.push(el.to_i(16))
      end

      a.push(255)
      return to_f(a)
    end
Convert from hex value (e.g. #FFF000) to Float (0.0..1.0)