A collection of accessible pygments styles
This package includes a collection of accessible themes for pygments based on different sources.
The following themes are AAA compliant with WCAG 2.1 criteria for color contrast.
a11y-dark
a11y-high-contrast-dark
pitaya-smoothie
- Colorblindness friendly.github-light
- Colorblindness friendly.github-dark
- Colorblindness friendly.github-light-colorblind
- Colorblindness friendly.github-dark-colorblind
- Colorblindness friendly.github-light-high-contrast
- Colorblindness friendly.github-dark-high-contrast
- Colorblindness friendly.gotthard-dark
- Colorblindness friendly.The following themes are AA compliant with WCAG 2.1 criteria for color contrast.
a11y-light
a11y-high-contrast-light
gotthard-light
- Colorblindness friendly.blinds-light
- Colorblindness friendly.blinds-dark
- Colorblindness friendly.greative
- Accessible to most forms of colorblindness and low light settings.For a demo of all our themes please click here!
Our package is available in both conda and pip via,
conda install -c conda-forge accessible-pygments
pip install accessible-pygments
If you want to install it directly from source,
git clone git@github.com:Quansight-Labs/accessible-pygments.git
cd accessible-pygments
pip install .
Import it using the name identifier for the desired theme,
from pygments.formatters import HtmlFormatter
HtmlFormatter(style='a11y-light').style
<class 'accessible-pygments.A11yLight'>
Just open a terminal and run,
python test/run_tests.py
You will see the results under test/results
in html format for each supported theme.
We want to thank the following sources for being the source of inspiration of one or more themes that are available in this repository,