fontColor(self,
patch_type)
|
|
Get the font color for the specified patch type. The font color will
be either black or white, whichever is more readable against the current
color setting for the specified patch type.
- Parameters:
patch_type (PatchType) - The patch type to get the font color for
- Returns: tuple
- The font color as a tuple of integer (r, g, b) values
Note:
The font color is calculated by determining the luma value of the
patch color. If the luma is greater than 50% (i.e. closer to white
than black), then a black font color is used. If the luma is less
than 50% (i.e. closer to black than white), then a white font color
is used. See http://24ways.org/2010/calculating-color-contrast/
and http://www.w3.org/TR/AERT#color-contrast for additional
information.
|