XLookupColor and XParseColor can generate BadColor error. Note that h indicates the value scaled in 4 bits, hh the value scaled in 8 bits, hhh the value scaled in 12 bits, and hhhh the value scaled in 16 bits, respectively. For backward compatibility, an older syntax for RGB Device is supported, but its continued use is not encouraged. The R, G, and B represent single hexadecimal digits. The input format for these values is an optional sign, a string of numbers possibly containing a decimal point, and an optional exponent field containing an E or e followed by a possibly signed integer string.
Some numeric value falls outside the range of values accepted by the request.
Unless a specific range is specified for an argument, the full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can gen- erate this error.