diff --git a/a11y_pygments/github_light_high_contrast/README.md b/a11y_pygments/github_light_high_contrast/README.md new file mode 100644 index 0000000..f273885 --- /dev/null +++ b/a11y_pygments/github_light_high_contrast/README.md @@ -0,0 +1,23 @@ +# Github light high contrast + +This is the pygments implementation of [`github light high contrast`](https://github.com/primer/github-vscode-theme). + +![Screenshot of the light accessibility theme in a bash script](./images/github-light-hc.png) + +## Colors + +Background color: ![#ffffff](https://via.placeholder.com/20/ffffff/ffffff.png) `#ffffff` + +Highlight color: ![#0969da](https://via.placeholder.com/20/0969da/0969da.png) `#0969da` + +**WCAG compliance** + +| Color | Hex | Ratio | Normal text | Large text | +| ----- | --- | ----- | ----------- | ---------- | +| ![#66707b](https://via.placeholder.com/20/66707b/66707b.png) | `#66707b` | 5.1 : 1 | AA | AAA | +| ![#a0111f](https://via.placeholder.com/20/a0111f/a0111f.png) | `#a0111f` | 8.1 : 1 | AAA | AAA | +| ![#702c00](https://via.placeholder.com/20/702c00/702c00.png) | `#702c00` | 10.2 : 1 | AAA | AAA | +| ![#024c1a](https://via.placeholder.com/20/024c1a/024c1a.png) | `#024c1a` | 10.2 : 1 | AAA | AAA | +| ![#023b95](https://via.placeholder.com/20/023b95/023b95.png) | `#023b95` | 10.2 : 1 | AAA | AAA | +| ![#622cbc](https://via.placeholder.com/20/622cbc/622cbc.png) | `#622cbc` | 8.1 : 1 | AAA | AAA | +| ![#24292f](https://via.placeholder.com/20/24292f/24292f.png) | `#24292f` | 14.7 : 1 | AAA | AAA | diff --git a/a11y_pygments/github_light_high_contrast/__init__.py b/a11y_pygments/github_light_high_contrast/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/a11y_pygments/github_light_high_contrast/images/github-light-hc.png b/a11y_pygments/github_light_high_contrast/images/github-light-hc.png new file mode 100644 index 0000000..6282689 Binary files /dev/null and b/a11y_pygments/github_light_high_contrast/images/github-light-hc.png differ diff --git a/a11y_pygments/github_light_high_contrast/style.css b/a11y_pygments/github_light_high_contrast/style.css new file mode 100644 index 0000000..2d61a5a --- /dev/null +++ b/a11y_pygments/github_light_high_contrast/style.css @@ -0,0 +1,77 @@ +pre { line-height: 125%; } +td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +.hll { background-color: #0969da } +.c { color: #66707b } /* Comment */ +.err { color: #a0111f } /* Error */ +.k { color: #a0111f } /* Keyword */ +.l { color: #702c00 } /* Literal */ +.n { color: #622cbc } /* Name */ +.o { color: #024c1a } /* Operator */ +.p { color: #24292f } /* Punctuation */ +.ch { color: #66707b } /* Comment.Hashbang */ +.cm { color: #66707b } /* Comment.Multiline */ +.cp { color: #66707b } /* Comment.Preproc */ +.cpf { color: #66707b } /* Comment.PreprocFile */ +.c1 { color: #66707b } /* Comment.Single */ +.cs { color: #66707b } /* Comment.Special */ +.gd { color: #023b95 } /* Generic.Deleted */ +.ge { font-style: italic } /* Generic.Emph */ +.gr { color: #a0111f } /* Generic.Error */ +.gh { color: #023b95 } /* Generic.Heading */ +.gs { font-weight: bold } /* Generic.Strong */ +.gu { color: #023b95 } /* Generic.Subheading */ +.kc { color: #023b95 } /* Keyword.Constant */ +.kd { color: #a0111f } /* Keyword.Declaration */ +.kn { color: #a0111f } /* Keyword.Namespace */ +.kp { color: #a0111f } /* Keyword.Pseudo */ +.kr { color: #a0111f } /* Keyword.Reserved */ +.kt { color: #a0111f } /* Keyword.Type */ +.ld { color: #702c00 } /* Literal.Date */ +.m { color: #702c00 } /* Literal.Number */ +.s { color: #023b95 } /* Literal.String */ +.na { color: #702c00 } /* Name.Attribute */ +.nb { color: #702c00 } /* Name.Builtin */ +.nc { color: #023b95 } /* Name.Class */ +.no { color: #023b95 } /* Name.Constant */ +.nd { color: #702c00 } /* Name.Decorator */ +.ni { color: #024c1a } /* Name.Entity */ +.ne { color: #622cbc } /* Name.Exception */ +.nf { color: #023b95 } /* Name.Function */ +.nl { color: #702c00 } /* Name.Label */ +.nn { color: #24292f } /* Name.Namespace */ +.nx { color: #622cbc } /* Name.Other */ +.py { color: #023b95 } /* Name.Property */ +.nt { color: #024c1a } /* Name.Tag */ +.nv { color: #702c00 } /* Name.Variable */ +.ow { color: #622cbc } /* Operator.Word */ +.pm { color: #24292f } /* Punctuation.Marker */ +.w { color: #24292f } /* Text.Whitespace */ +.mb { color: #702c00 } /* Literal.Number.Bin */ +.mf { color: #702c00 } /* Literal.Number.Float */ +.mh { color: #702c00 } /* Literal.Number.Hex */ +.mi { color: #702c00 } /* Literal.Number.Integer */ +.mo { color: #702c00 } /* Literal.Number.Oct */ +.sa { color: #023b95 } /* Literal.String.Affix */ +.sb { color: #023b95 } /* Literal.String.Backtick */ +.sc { color: #023b95 } /* Literal.String.Char */ +.dl { color: #023b95 } /* Literal.String.Delimiter */ +.sd { color: #023b95 } /* Literal.String.Doc */ +.s2 { color: #023b95 } /* Literal.String.Double */ +.se { color: #023b95 } /* Literal.String.Escape */ +.sh { color: #023b95 } /* Literal.String.Heredoc */ +.si { color: #023b95 } /* Literal.String.Interpol */ +.sx { color: #023b95 } /* Literal.String.Other */ +.sr { color: #023b95 } /* Literal.String.Regex */ +.s1 { color: #023b95 } /* Literal.String.Single */ +.ss { color: #023b95 } /* Literal.String.Symbol */ +.bp { color: #702c00 } /* Name.Builtin.Pseudo */ +.fm { color: #023b95 } /* Name.Function.Magic */ +.vc { color: #702c00 } /* Name.Variable.Class */ +.vg { color: #702c00 } /* Name.Variable.Global */ +.vi { color: #702c00 } /* Name.Variable.Instance */ +.vm { color: #702c00 } /* Name.Variable.Magic */ +.il { color: #702c00 } /* Literal.Number.Integer.Long */ + .highlight { background: #ffffff; color: #24292f; } \ No newline at end of file diff --git a/a11y_pygments/github_light_high_contrast/style.py b/a11y_pygments/github_light_high_contrast/style.py new file mode 100644 index 0000000..c658c7a --- /dev/null +++ b/a11y_pygments/github_light_high_contrast/style.py @@ -0,0 +1,102 @@ +from pygments.style import Style +from pygments.token import ( + Keyword, Name, Comment, String, Error, Text, Number, Operator, Generic, + Punctuation, Other, Literal) + + +class Colors: + comment = "#66707b" # grey[5] + red = "#a0111f" # red[5] + orange = "#702c00" # orange[6] + green = "#024c1a" # green[6] + blue = "#023b95" # blue[6] + purple = "#622cbc" # purple[5] + black = "#24292f" # fg.default + + +class Theme(Style): + """ + This style mimics the github light high contrast theme from vscode themes. + """ + + default_style = '' + + background_color = "#ffffff" # canvas.default + highlight_color = "#0969da" # accent.fg + + styles = { + Text: Colors.black, # class: '' + Error: Colors.red, # class: 'err' + Other: "", # class 'x' + + Comment: Colors.comment, # class: 'c' + + Keyword: Colors.red, # class: 'k' + Keyword.Constant: Colors.blue, # class: 'kc' + # Keyword.Declaration: "", # class: 'kd' + # Keyword.Namespace: "", # class: 'kn' + # Keyword.Pseudo: "", # class: 'kp' + # Keyword.Reserved: "", # class: 'kr' + Keyword.Type: Colors.red, # class: 'kt' + + Operator: Colors.green, # class: 'o' + Operator.Word: Colors.purple, # class: 'ow' + + Punctuation: Colors.black, # class: 'p' + + Name: Colors.purple, # class: 'n' + Name.Attribute: Colors.orange, # class: 'na' + Name.Builtin: Colors.orange, # class: 'nb' + Name.Builtin.Pseudo: Colors.orange, # class: 'bp' + Name.Class: Colors.blue, # class: 'nc' + Name.Constant: Colors.blue, # class: 'no' + Name.Decorator: Colors.orange, # class: 'nd' + Name.Entity: Colors.green, # class: 'ni' + Name.Exception: Colors.purple, # class: 'ne' + Name.Function: Colors.blue, # class: 'nf' + Name.Property: Colors.blue, # class: 'py' + Name.Label: Colors.orange, # class: 'nl' + Name.Namespace: Colors.black, # class: 'nn' + # Name.Other: "", # class: 'nx' + Name.Tag: Colors.green, # class: 'nt' + Name.Variable: Colors.orange, # class: 'nv' + Name.Variable.Magic: Colors.orange, + # Name.Variable.Class: "", # class: 'vc' + # Name.Variable.Global: "", # class: 'vg' + # Name.Variable.Instance: "", # class: 'vi' + + Number: Colors.orange, # class: 'm' + # Number.Float: "", # class: 'mf' + # Number.Hex: "", # class: 'mh' + # Number.Integer: "", # class: 'mi' + # Number.Integer.Long: "", # class: 'il' + # Number.Oct: "", # class: 'mo' + + Literal: Colors.orange, # class: 'l' + # Literal.Date: "", # class: 'ld' + + String: Colors.blue, # class: 's' + String.Backtick: Colors.blue, # class: 'sb' + # String.Char: "", # class: 'sc' + # String.Doc: "", # class: 'sd' + # String.Double: "", # class: 's2' + # String.Escape: "", # class: 'se' + # String.Heredoc: "", # class: 'sh' + # String.Interpol: "", # class: 'si' + # String.Other: "", # class: 'sx' + String.Regex: Colors.blue, # class: 'sr' + # String.Single: "", # class: 's1' + String.Symbol: Colors.blue, # class: 'ss' + + # Generic: "", # class: 'g' + Generic.Deleted: Colors.blue, # class: 'gd', + Generic.Emph: "italic", # class: 'ge' + Generic.Error: Colors.red, # class: 'gr' + Generic.Heading: Colors.blue, # class: 'gh' + Generic.Subheading: Colors.blue, # class: 'gu' + # Generic.Inserted: "", # class: 'gi' + # Generic.Output: "", # class: 'go' + # Generic.Prompt: "", # class: 'gp' + Generic.Strong: "bold", # class: 'gs' + # Generic.Traceback: "", # class: 'gt' + } \ No newline at end of file diff --git a/docs/css/github_light_high_contrast-style.css b/docs/css/github_light_high_contrast-style.css new file mode 100644 index 0000000..2d61a5a --- /dev/null +++ b/docs/css/github_light_high_contrast-style.css @@ -0,0 +1,77 @@ +pre { line-height: 125%; } +td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +.hll { background-color: #0969da } +.c { color: #66707b } /* Comment */ +.err { color: #a0111f } /* Error */ +.k { color: #a0111f } /* Keyword */ +.l { color: #702c00 } /* Literal */ +.n { color: #622cbc } /* Name */ +.o { color: #024c1a } /* Operator */ +.p { color: #24292f } /* Punctuation */ +.ch { color: #66707b } /* Comment.Hashbang */ +.cm { color: #66707b } /* Comment.Multiline */ +.cp { color: #66707b } /* Comment.Preproc */ +.cpf { color: #66707b } /* Comment.PreprocFile */ +.c1 { color: #66707b } /* Comment.Single */ +.cs { color: #66707b } /* Comment.Special */ +.gd { color: #023b95 } /* Generic.Deleted */ +.ge { font-style: italic } /* Generic.Emph */ +.gr { color: #a0111f } /* Generic.Error */ +.gh { color: #023b95 } /* Generic.Heading */ +.gs { font-weight: bold } /* Generic.Strong */ +.gu { color: #023b95 } /* Generic.Subheading */ +.kc { color: #023b95 } /* Keyword.Constant */ +.kd { color: #a0111f } /* Keyword.Declaration */ +.kn { color: #a0111f } /* Keyword.Namespace */ +.kp { color: #a0111f } /* Keyword.Pseudo */ +.kr { color: #a0111f } /* Keyword.Reserved */ +.kt { color: #a0111f } /* Keyword.Type */ +.ld { color: #702c00 } /* Literal.Date */ +.m { color: #702c00 } /* Literal.Number */ +.s { color: #023b95 } /* Literal.String */ +.na { color: #702c00 } /* Name.Attribute */ +.nb { color: #702c00 } /* Name.Builtin */ +.nc { color: #023b95 } /* Name.Class */ +.no { color: #023b95 } /* Name.Constant */ +.nd { color: #702c00 } /* Name.Decorator */ +.ni { color: #024c1a } /* Name.Entity */ +.ne { color: #622cbc } /* Name.Exception */ +.nf { color: #023b95 } /* Name.Function */ +.nl { color: #702c00 } /* Name.Label */ +.nn { color: #24292f } /* Name.Namespace */ +.nx { color: #622cbc } /* Name.Other */ +.py { color: #023b95 } /* Name.Property */ +.nt { color: #024c1a } /* Name.Tag */ +.nv { color: #702c00 } /* Name.Variable */ +.ow { color: #622cbc } /* Operator.Word */ +.pm { color: #24292f } /* Punctuation.Marker */ +.w { color: #24292f } /* Text.Whitespace */ +.mb { color: #702c00 } /* Literal.Number.Bin */ +.mf { color: #702c00 } /* Literal.Number.Float */ +.mh { color: #702c00 } /* Literal.Number.Hex */ +.mi { color: #702c00 } /* Literal.Number.Integer */ +.mo { color: #702c00 } /* Literal.Number.Oct */ +.sa { color: #023b95 } /* Literal.String.Affix */ +.sb { color: #023b95 } /* Literal.String.Backtick */ +.sc { color: #023b95 } /* Literal.String.Char */ +.dl { color: #023b95 } /* Literal.String.Delimiter */ +.sd { color: #023b95 } /* Literal.String.Doc */ +.s2 { color: #023b95 } /* Literal.String.Double */ +.se { color: #023b95 } /* Literal.String.Escape */ +.sh { color: #023b95 } /* Literal.String.Heredoc */ +.si { color: #023b95 } /* Literal.String.Interpol */ +.sx { color: #023b95 } /* Literal.String.Other */ +.sr { color: #023b95 } /* Literal.String.Regex */ +.s1 { color: #023b95 } /* Literal.String.Single */ +.ss { color: #023b95 } /* Literal.String.Symbol */ +.bp { color: #702c00 } /* Name.Builtin.Pseudo */ +.fm { color: #023b95 } /* Name.Function.Magic */ +.vc { color: #702c00 } /* Name.Variable.Class */ +.vg { color: #702c00 } /* Name.Variable.Global */ +.vi { color: #702c00 } /* Name.Variable.Instance */ +.vm { color: #702c00 } /* Name.Variable.Magic */ +.il { color: #702c00 } /* Literal.Number.Integer.Long */ + .highlight { background: #ffffff; color: #24292f; } \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 6c6b8f0..99a469c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -14,6 +14,7 @@ +