def brightness(formula=:w3c)
      case formula
        when :standard
          Math.sqrt(0.241 * r**2 + 0.691 * g**2 + 0.068 * b**2) / 255
        when :w3c
          ((r * 299 + g * 587 + b * 114) / 255000.0)
      end
    end
def brightness(formula=:w3c)
      case formula
        when :standard
          Math.sqrt(0.241 * r**2 + 0.691 * g**2 + 0.068 * b**2) / 255
        when :w3c
          ((r * 299 + g * 587 + b * 114) / 255000.0)
      end
    end
Returns the perceived brightness of the provided color on a
 scale of 0.0 to 1.0 based on the formula provided. The formulas
 available are:

 * <tt>:w3c</tt> - <tt>((r * 299 + g * 587 + b * 114) / 1000 / 255</tt>
 * <tt>:standard</tt> - <tt>sqrt(0.241 * r^2 + 0.691 * g^2 + 0.068 * b^2) / 255</tt>