contrast static method

List<double> contrast(
  1. double value
)

Contrast adjustment

Implementation

static List<double> contrast(double value) {
  final double adj = value * 255;
  final double factor = (259 * (adj + 255)) / (255 * (259 - adj));

  return <double>[
    factor,
    0,
    0,
    0,
    128 * (1 - factor),
    0,
    factor,
    0,
    0,
    128 * (1 - factor),
    0,
    0,
    factor,
    0,
    128 * (1 - factor),
    0,
    0,
    0,
    1,
    0,
  ];
}