def to_s(format=:css)
      case format
        when :css
          "#%.2x%.2x%.2x" % [r, g, b]
        when :css_rgb
          "rgb(%.2f,%.2f,%.2f)" % [r, g, b]
        when :rgb
          "%.3f, %.3f, %.3f" % [r / 255, g / 255, b / 255]
      end
    end
def to_s(format=:css)
      case format
        when :css
          "#%.2x%.2x%.2x" % [r, g, b]
        when :css_rgb
          "rgb(%.2f,%.2f,%.2f)" % [r, g, b]
        when :rgb
          "%.3f, %.3f, %.3f" % [r / 255, g / 255, b / 255]
      end
    end
Outputs a string representation of the color in the desired format.
 The available formats are:

 * <tt>:css</tt> - As a CSS hex string (i.e. <tt>#ffffff</tt>) (default)
 * <tt>:css_rgb</tt> - As a CSS RGB value string (i.e. <tt>rgb(255,255,255)</tt>)
 * <tt>:rgb</tt> - As an RGB triplet (i.e. <tt>1.0, 1.0, 1.0</tt>)