simulateCvd function

LinRgb simulateCvd(
  1. LinRgb c,
  2. Cvd type
)

Full-severity simulation of type on linear sRGB c.

Implementation

LinRgb simulateCvd(LinRgb c, Cvd type) => switch (type) {
  Cvd.protan => _mul(machadoProtan, c),
  Cvd.deutan => _mul(machadoDeutan, c),
  Cvd.tritan => _mul(
    brettelTritanNormal[0] * c.$1 +
                brettelTritanNormal[1] * c.$2 +
                brettelTritanNormal[2] * c.$3 >=
            0
        ? brettelTritan1
        : brettelTritan2,
    c,
  ),
};