Last modified on 27 October 2012, at 22:16

REBOL Programming/brightness?

USAGE:Edit

BRIGHTNESS? color 

DESCRIPTION:Edit

Returns the monochrome brightness (0.0 to 1.0) for a color value.

BRIGHTNESS? is a function value.

ARGUMENTSEdit

  • color -- (Type: tuple)

SOURCE CODEEdit

brightness?: func [
    {Returns the monochrome brightness (0.0 to 1.0) for a color value.} 
    color [tuple!]
][
    (0.27 * color/1) + (0.63 * color/2) + (0.1 * color/3) / 255
]