luma method
- Color color
Calculates the luma (perceptual brightness) of a color object. Parameters: color - a color object. Returns: percentage 0-100% Example: luma(rgb(100, 200, 30)) Output: 44%
Implementation
//
/// Parameters:
/// color - a color object.
/// Returns: percentage 0-100%
/// Example: luma(rgb(100, 200, 30))
/// Output: 44%
///
Dimension luma(Color color) =>
Dimension(color.luma() * color.alpha * 100, '%');