Skip to content

Instantly share code, notes, and snippets.

@guilhermgonzaga
Last active September 21, 2020 17:14
Show Gist options
  • Save guilhermgonzaga/e5799f4fa8cee0af528e895fc455410d to your computer and use it in GitHub Desktop.
Save guilhermgonzaga/e5799f4fa8cee0af528e895fc455410d to your computer and use it in GitHub Desktop.
Color Scheme definition of the Sublime Text version of Monokai for use with Pygments. Mainly focused on C++ syntax highlighting.
""" pygments.styles.monokaist
Closely mimic the Sublime Text version of Monokai color scheme.
Made with the C++ syntax in mind, so YMMV.
Check out https://pygments.org/docs/styles/#creating-own-styles
for instructions on how to use.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, Text, \
Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
MONOKAIST_BACKGROUND = "#272822"
MONOKAIST_BLUE = "#66D9EF"
MONOKAIST_COMENT = "#75715E"
MONOKAIST_GRAY = "#7E7E7B"
MONOKAIST_GREEN = "#A6E22E"
MONOKAIST_HIGHLIGHT = "#49483E"
MONOKAIST_PINK = "#F92472"
MONOKAIST_PURPLE = "#AE81FF"
MONOKAIST_RED = "#F92672"
MONOKAIST_WHITE = "#FFFFF9"
MONOKAIST_YELLOW = "#E6DB74"
class MonokaistStyle(Style):
background_color = MONOKAIST_BACKGROUND
highlight_color = MONOKAIST_HIGHLIGHT
styles = {
Text: MONOKAIST_WHITE,
Whitespace: "",
Error: MONOKAIST_PINK + " bg:#1E0010",
Other: "", # class 'x'
Comment: MONOKAIST_COMENT,
Comment.Multiline: "",
Comment.Preproc: MONOKAIST_RED,
Comment.Single: "",
Comment.Special: "",
Keyword: MONOKAIST_RED,
Keyword.Constant: "",
Keyword.Declaration: "",
Keyword.Namespace: "",
Keyword.Pseudo: "",
Keyword.Reserved: "",
Keyword.Type: "italic " + MONOKAIST_BLUE,
Operator: MONOKAIST_WHITE,
Operator.Word: "",
Punctuation: MONOKAIST_WHITE,
Name: MONOKAIST_WHITE,
Name.Attribute: MONOKAIST_GREEN,
Name.Builtin: MONOKAIST_PURPLE,
Name.Builtin.Pseudo: "",
Name.Class: MONOKAIST_GREEN,
Name.Constant: MONOKAIST_BLUE,
Name.Decorator: MONOKAIST_GREEN,
Name.Entity: "",
Name.Exception: MONOKAIST_GREEN,
Name.Function: MONOKAIST_GREEN,
Name.Property: "",
Name.Label: "",
Name.Namespace: "",
Name.Other: MONOKAIST_GREEN,
Name.Tag: MONOKAIST_RED,
Name.Variable: "",
Name.Variable.Class: "",
Name.Variable.Global: "",
Name.Variable.Instance: "",
Number: MONOKAIST_PURPLE,
Number.Float: "",
Number.Hex: "",
Number.Integer: "",
Number.Integer.Long: "",
Number.Oct: "",
Literal: MONOKAIST_PURPLE,
Literal.Date: MONOKAIST_YELLOW,
String: MONOKAIST_YELLOW,
String.Backtick: "",
String.Char: "",
String.Doc: "",
String.Double: "",
String.Escape: MONOKAIST_PURPLE,
String.Heredoc: "",
String.Interpol: "",
String.Other: "",
String.Regex: "",
String.Single: "",
String.Symbol: "",
Generic: "",
Generic.Deleted: MONOKAIST_RED,
Generic.Emph: "italic",
Generic.Error: "",
Generic.Heading: "",
Generic.Inserted: MONOKAIST_GREEN,
Generic.Output: "",
Generic.Prompt: "",
Generic.Strong: "bold",
Generic.Subheading: MONOKAIST_COMENT,
Generic.Traceback: "",
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment