Convert a named or hex color string to an RGB array. If the color begins with the # character it will be treated as a hex value. Everything else will be treated as a named color. If the named color is not known, black will be returned.
Determine if a light or dark text color would be more readable on a background of a given color. This is determined by the G(reen) value of RGB. You can change the dark and the light colors from their default black and white.
Return: The light or dark value which would make the text most readable.