ColorOperatorsMethods extension Null safety

  • inverted, for returning -this
  • compareLuminance, for returning the brighter or darker Color utilizing >
  • or, for randomization by Color | List<Color>

The following methods resemble the operator counterparts but they have a slot for provision of a strength or alpha/opacity override (see alphaFromStrength for details):

  • add, to + one Color to another
  • subtract, to - one Color from another
  • average, to ~/ all channels of two Colors
on

Properties

inverted Color
Invert red, green and blue channels of this, maintaining alpha.
read-only

Methods

add(Color other, [dynamic strength]) Color
Add the red, green, and blue channels of other with those of this Color. The resultant alpha is maintained from this, unless a strength would be specified which is used instead. [...]
average(Color other, [dynamic strength]) Color
Average the alpha, red, green, and blue channels of a Color with another other. [...]
compareLuminance(Color other, {bool returnBrighter = true}) Color
Exposure method for > operator. [...]
or(dynamic others) Color
Exposure method for | operator: random Color access. [...]
subtract(Color other, [dynamic strength]) Color
Subtract the red, green, and blue channels of other from those of this Color. The resultant alpha is maintained from this, unless a strength would be specified which is used instead. [...]