@OPEN-KAPPA/COLORS
    Preparing search index...

    Class CvdAbstract

    Class to support color blindness simulation and correction.

    Index

    Methods

    • Corrects a color to make it distinguishable for color-blind users. Uses the "Error Diffusion" method: calculates the information lost during simulation and shifts it into a visible spectrum (e.g., shifting lost Red/Green info into Blue/Lightness).

      Parameters

      • color: LinearRgb

        The original color.

      • type: CvdType

        The type of color blindness to simulate.

      • severity: number = 1.0

        The severity to correct.

      Returns LinearRgb

      The corrected color.

    • Simulates how a color appears to a person with CVD. Based on Brettel/Viénot/Mollon algorithm via Linear RGB projection.

      Parameters

      • color: LinearRgb

        The original color.

      • type: CvdType

        The type of color blindness to simulate.

      • severity: number = 1.0

        The severity to correct.

      Returns LinearRgb

      The deteriorated color.

    • Simulates how a color appears to a person with CVD. This is just a wrapper of simulate().

      Type Parameters

      Parameters

      • color: C

        The original color.

      • type: CvdType

        The type of color blindness to simulate.

      • severity: number = 1.0

        The severity to correct.

      Returns LinearRgb | C

      The deteriorated color.

      Cvd.simulate()