Vocabulary
colors.ryb.private

Inputs and outputs
r!an object
g!an object
b!an object
ran object
yan object
ban object


Definition


:: rgb>ryb ( r! g! b! -- r y b )
r g b max max :> mg r g min :> y! r y - r! g y - g! b g
[ 0 > ] both? [ b 2 /f b! g 2 /f g! ] when y g + y! b g +
b! r y b 3dup max max
[ mg swap / [ * ] curry tri@ ] unless-zero ;