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 -
Available on Color, provided by the ColorOperators extension
Color Addition Operator -
operator -(
Color other) → Color -
Available on Color, provided by the ColorOperators extension
Color Subtraction Operator -
operator <(
Color other) → bool -
Available on Color, provided by the ColorOperators extension
Color Less Than Operator -
operator >(
Color other) → bool -
Available on Color, provided by the ColorOperators extension
Color Greater Than Operator -
operator unary-(
) → Color -
Available on Color, provided by the ColorOperators extension
Color Inversion Operator -
operator |(
dynamic others) → Color -
Available on Color, provided by the ColorOperators extension
Color Or Operator -
operator ~/(
Color other) → Color -
Available on Color, provided by the ColorOperators extension
Color Average Operator