The color to return its simulated variant. The default is cyan.
Optionaloptions: DeficiencyOptions = ...The optional overrides for tweaking the final output.
import { deficiency } from '@skchr/color'
// Here we are simulating color blindness of tritanomaly or we can't see 'blue'.
// We are passing in our color as an array of channel values in the mode "rgb". The severity is set to 0.5
console.log(deficiency(['rgb', 230, 100, 50, 0.5],{ kind:'blue', severity:0.5 }))
// '#dd663680'
Simulates how a color may be perceived by people with color vision deficiency.
To avoid writing the long types, the expected parameters for the
kindof blindness are simply the colors that are hard to perceive for the type of color blindness:'monochromacy'- An inability to see color, only perceiving shades of gray. Thekindismono.'tritanopia'- An inability to distinguish the color 'blue'. Thekindis'blue'.'deuteranopia'- An inability to distinguish the color 'green'.. Thekindis'green'.'protanopia'- An inability to distinguish the color 'red'. Thekindis'red'.