Expand description
Contrast ratios between tones, and tones that reach a given ratio.
The safe functions return None where upstream returns -1.
Functionsยง
- darker
- A tone at least as dark as
tonethat reachesratio, if one exists. - darker_
unsafe darker, or 0 whenratiocannot be reached.- lighter
- A tone at least as light as
tonethat reachesratio, if one exists. - lighter_
unsafe lighter, or 100 whenratiocannot be reached.- ratio_
of_ tones - The contrast ratio of two tones, from 1 to 21. Tones are clamped to 0..=100.
- ratio_
of_ ys - The contrast ratio of two relative luminances.