Learn R Programming

biometryassist (version 1.3.0)

.is_light_colour: Determine if a Colour is Light

Description

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).

Usage

.is_light_colour(colour)

Value

Logical. TRUE if the colour is light (luminance > 0.5), FALSE if dark.

Arguments

colour

A colour specification (hex code, named colour, etc.)

Details

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).