ColorOperators extension

ColorOperators extends Color with operators support.

  • -, to invert a Color

  • > & <, to compare the luminance of Colors

  • + & -, to add/subtract the RGB components to/from one another, maintaining the alpha from the original color this

  • ~/, to average all components of two colors together, including alpha

  • |, to randomly choose a Color, either this or Color other; unless the operand on the right is a List<Color>, then the random choice may come from the list or this.

on

Operators

operator +(Color other) Color
Color Addition Operator
operator -(Color other) Color
Color Subtraction Operator
operator <(Color other) bool
Color Less Than Operator
operator >(Color other) bool
Color Greater Than Operator
operator unary-() Color
Color Inversion Operator
operator |(dynamic others) Color
Color Or Operator
operator ~/(Color other) Color
Color Average Operator