withTint static method

Color withTint(
  1. Color color,
  2. num tintFactor
)

tint_factor < 1.0

Implementation

static Color withTint(Color color, num tintFactor) {
  var r = color.red + (255 - color.red) * tintFactor;
  var g = color.green + (255 - color.green) * tintFactor;
  var b = color.blue + (255 - color.blue) * tintFactor;
  return Color.fromRGBO(r.toInt(), g.toInt(), b.toInt(), color.opacity);
}