Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix contrast failures for high contrast light theme #33

Merged
merged 14 commits into from
Apr 4, 2024
22 changes: 12 additions & 10 deletions a11y_pygments/a11y_high_contrast_light/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
# A11Y High Contrast Light

This style mimics the a11 light theme from eric bailey's accessible themes.
This style mimics the a11y-light theme (but with more contrast) from eric bailey's accessible themes.

![Screenshot of the a11y-high-contrast-light theme in a bash script](./images/a11y-high-contrast-light.png)

## Colors

Background color: ![#fefefe](https://via.placeholder.com/20/fefefe/fefefe.png) `#fefefe`

Highlight color: ![#7971292e](https://via.placeholder.com/20/7971292e/7971292e.png) `#7971292e`
Highlight color: ![#fae4c2](https://via.placeholder.com/20/fae4c2/fae4c2.png) `#fae4c2`

**WCAG compliance**

| Color | Hex | Ratio | Normal text | Large text |
| ------------------------------------------------------------ | --------- | ------- | ----------- | ---------- |
| ![#797129](https://via.placeholder.com/20/797129/797129.png) | `#797129` | 4.9 : 1 | AA | AAA |
| ![#d91e18](https://via.placeholder.com/20/d91e18/d91e18.png) | `#d91e18` | 5.0 : 1 | AA | AAA |
| ![#008000](https://via.placeholder.com/20/008000/008000.png) | `#008000` | 5.1 : 1 | AA | AAA |
| ![#007faa](https://via.placeholder.com/20/007faa/007faa.png) | `#007faa` | 4.5 : 1 | AA | AAA |
| ![#7928a1](https://via.placeholder.com/20/7928a1/7928a1.png) | `#7928a1` | 7.9 : 1 | AAA | AAA |
| ![#545454](https://via.placeholder.com/20/545454/545454.png) | `#545454` | 7.5 : 1 | AAA | AAA |
| Color | Hex | Ratio | Normal text | Large text |
| ------------------------------------------------------------ | --------- | -------- | ----------- | ---------- |
| ![#515151](https://via.placeholder.com/20/515151/515151.png) | `#515151` | 7.9 : 1 | AAA | AAA |
| ![#a12236](https://via.placeholder.com/20/a12236/a12236.png) | `#a12236` | 7.4 : 1 | AAA | AAA |
| ![#7f4707](https://via.placeholder.com/20/7f4707/7f4707.png) | `#7f4707` | 7.4 : 1 | AAA | AAA |
| ![#912583](https://via.placeholder.com/20/912583/912583.png) | `#912583` | 7.4 : 1 | AAA | AAA |
| ![#00622f](https://via.placeholder.com/20/00622f/00622f.png) | `#00622f` | 7.5 : 1 | AAA | AAA |
| ![#005b82](https://via.placeholder.com/20/005b82/005b82.png) | `#005b82` | 7.4 : 1 | AAA | AAA |
| ![#6730c5](https://via.placeholder.com/20/6730c5/6730c5.png) | `#6730c5` | 7.4 : 1 | AAA | AAA |
| ![#080808](https://via.placeholder.com/20/080808/080808.png) | `#080808` | 19.9 : 1 | AAA | AAA |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 11 additions & 11 deletions a11y_pygments/a11y_high_contrast_light/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@


class Colors:
comment = "#797129"
red = "#d91e18"
orange = "#797129"
yellow = "#797129"
green = "#008000"
blue = "#007faa"
purple = "#7928a1"
black = "#545454"
comment = "#515151"
red = "#a12236"
orange = "#7f4707"
magenta = "#912583"
green = "#00622f"
blue = "#005b82"
purple = "#6730c5"
black = "#080808"


class Theme(Style):
"""
This style mimics the a11 light theme from eric bailey's accessible themes.
This style mimics the a11y-light theme (but with more contrast) from eric bailey's accessible themes.
"""

default_style = ""

background_color = "#fefefe"
highlight_color = "#7971292e"
highlight_color = "#fae4c2"

styles = {
Text: Colors.black, # class: ''
Expand All @@ -52,7 +52,7 @@ class Theme(Style):
Operator.Word: Colors.purple, # class: 'ow'
Punctuation: Colors.black, # class: 'p'
Name: Colors.black, # class: 'n'
Name.Attribute: Colors.yellow, # class: 'na'
Name.Attribute: Colors.magenta, # class: 'na'
Name.Builtin: Colors.orange, # class: 'nb'
Name.Builtin.Pseudo: Colors.orange, # class: 'bp'
Name.Class: Colors.blue, # class: 'nc'
Expand Down
22 changes: 11 additions & 11 deletions a11y_pygments/a11y_light/README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# A11Y Light

This style mimics the a11 light theme from eric bailey's accessible themes.
This style inspired by the a11y-light theme from eric bailey's accessible themes.

![Screenshot of the a11y-light theme in a bash script](./images/a11y-light.png)

## Colors

Background color: ![#fefefe](https://via.placeholder.com/20/fefefe/fefefe.png) `#fefefe`

Highlight color: ![#7971292e](https://via.placeholder.com/20/7971292e/7971292e.png) `#7971292e`
Highlight color: ![#fdf2e2](https://via.placeholder.com/20/fdf2e2/fdf2e2.png) `#fdf2e2`

**WCAG compliance**

| Color | Hex | Ratio | Normal text | Large text |
| ------------------------------------------------------------ | --------- | ------- | ----------- | ---------- |
| ![#696969](https://via.placeholder.com/20/696969/696969.png) | `#696969` | 5.4 : 1 | AA | AAA |
| ![#d91e18](https://via.placeholder.com/20/d91e18/d91e18.png) | `#d91e18` | 5.0 : 1 | AA | AAA |
| ![#aa5d00](https://via.placeholder.com/20/aa5d00/aa5d00.png) | `#aa5d00` | 4.9 : 1 | AA | AAA |
| ![#008000](https://via.placeholder.com/20/008000/008000.png) | `#008000` | 5.1 : 1 | AA | AAA |
| ![#007faa](https://via.placeholder.com/20/007faa/007faa.png) | `#007faa` | 4.5 : 1 | AA | AAA |
| ![#7928a1](https://via.placeholder.com/20/7928a1/7928a1.png) | `#7928a1` | 7.9 : 1 | AAA | AAA |
| ![#545454](https://via.placeholder.com/20/545454/545454.png) | `#545454` | 7.5 : 1 | AAA | AAA |
| Color | Hex | Ratio | Normal text | Large text |
| ------------------------------------------------------------ | --------- | -------- | ----------- | ---------- |
| ![#515151](https://via.placeholder.com/20/515151/515151.png) | `#515151` | 7.9 : 1 | AAA | AAA |
| ![#d71835](https://via.placeholder.com/20/d71835/d71835.png) | `#d71835` | 5.1 : 1 | AA | AAA |
| ![#7f4707](https://via.placeholder.com/20/7f4707/7f4707.png) | `#7f4707` | 7.4 : 1 | AAA | AAA |
| ![#116633](https://via.placeholder.com/20/116633/116633.png) | `#116633` | 7.0 : 1 | AAA | AAA |
| ![#00749c](https://via.placeholder.com/20/00749c/00749c.png) | `#00749c` | 5.2 : 1 | AA | AAA |
| ![#8045e5](https://via.placeholder.com/20/8045e5/8045e5.png) | `#8045e5` | 5.3 : 1 | AA | AAA |
| ![#1e1e1e](https://via.placeholder.com/20/1e1e1e/1e1e1e.png) | `#1e1e1e` | 16.5 : 1 | AAA | AAA |
Binary file modified a11y_pygments/a11y_light/images/a11y-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 10 additions & 10 deletions a11y_pygments/a11y_light/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@


class Colors:
comment = "#696969"
red = "#d91e18"
orange = "#aa5d00"
yellow = "#aa5d00"
green = "#008000"
blue = "#007faa"
purple = "#7928a1"
black = "#545454"
comment = "#515151"
red = "#d71835"
orange = "#7f4707"
yellow = "#7f4707"
green = "#116633"
blue = "#00749c"
purple = "#8045e5"
black = "#1e1e1e"


class Theme(Style):
"""
This style mimics the a11 light theme from eric bailey's accessible themes.
This style inspired by the a11y-light theme from eric bailey's accessible themes.
"""

default_style = ""

background_color = "#fefefe"
highlight_color = "#7971292e"
highlight_color = "#fdf2e2"

styles = {
Text: Colors.black, # class: ''
Expand Down
Loading