Utility module that makes it easy to test how accessible combinations of colors are with each other. The common use case for these functions is to test your app colors for contrast, brightness, and color blindness contrast and then make adjustments to colors as needed.
Useful functions for loosely simulating various kinds of color blindness.
Note: These functions will not give you a color that can be easily viewed by someone with the disability. It will give you an approximation of how they view that color.
Approximation for Red color blindness
|0.567 0.433 0 |
|0.558 0.442 0 |
|0 0.242 0.758|Approximation for mostly Red color blindness
|0.817 0.183 0 |
|0.333 0.667 0 |
|0 0.125 0.875|Approximation for Green color blindness
|0.625 0.375 0 |
|0.7 0.3 0 |
|0 0.3 0.7|Approximation for mostly Green color blindness
|0.8 0.2 0 |
|0.258 0.742 0 |
|0 0.142 0.858|Approximation for Blue color blindness
|0.95 0.05 0 |
|0 0.433 0.567|
|0 0.475 0.525|Approximation for mostly Blue color blindness
|0.967 0.033 0 |
|0 0.733 0.267|
|0 0.183 0.817|Approximation for Complete color blindness
|0.299 0.587 0.114|
|0.299 0.587 0.114|
|0.299 0.587 0.114|Approximation for Mostly color blindness
|0.618 0.32 0.062|
|0.163 0.775 0.062|
|0.163 0.32 0.516|Approximation for normal eyes
|1 0 0|
|0 1 0|
|0 0 1|The contrast ratio between 2 colors. Returns a result between 1 and 21
Test for AA compliance
Test for AA compliance for text larger than 18pt
Test for AAA compliance
Test for AAA compliance for text larger than 18pt
The brightness difference between 2 colors. Returns a result between 0 and 255
The color difference between 2 colors. Returns a result between 0 and 765