ColorOperators extension
ColorOperators
extends Color
with operators support.
-
-, to invert a
Color
-
+ & -, 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
, eitherthis
orColor other
; unless the operand on the right is aList<Color>
, then the random choice may come from the list orthis
.
- 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