get_brightness: Get Brightness of a Color

Description Usage Arguments Details Value

Description

This function tries to return how "bright" (i.e. perceived luminance) a given color is based on psychological evaluations at the dawn of the color TV era.

Usage

1

Arguments

.colors

Vector or list with colors.This is passed to col2rgb and so accepts color names ("black"), hexadecimal rgb strings ("#rrggbb" or "#rrggbbaa") or positive integers (i meaning palette()[i]).

Details

This takes into account that the human eye is most sensitive to green, followed by red with blue colors appearing darker.

Everything is stolen from stackoverflow so don't sue me.

Value

A vector of brightness values between 0 and 1. 0 meaning black and 1 white.


STAT-UP/statupinternal documentation built on May 9, 2019, 11:43 a.m.