.is_light_colour | R Documentation |
Internal helper function to determine whether a colour is light or dark for appropriate font colour selection (black text on light backgrounds, white text on dark backgrounds).
.is_light_colour(colour)
colour |
A colour specification (hex code, named colour, etc.) |
Uses standard luminance calculation: 0.299R + 0.587G + 0.114*B, normalized to 0-1 scale. Coefficients reflect human eye sensitivity to different colours (green > red > blue).
Logical. TRUE if the colour is light (luminance > 0.5), FALSE if dark.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.