monokai.py 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. """
  2. pygments.styles.monokai
  3. ~~~~~~~~~~~~~~~~~~~~~~~
  4. Mimic the Monokai color scheme. Based on tango.py.
  5. http://www.monokai.nl/blog/2006/07/15/textmate-color-theme/
  6. :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
  7. :license: BSD, see LICENSE for details.
  8. """
  9. from pygments.style import Style
  10. from pygments.token import Keyword, Name, Comment, String, Error, Token, \
  11. Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
  12. __all__ = ['MonokaiStyle']
  13. class MonokaiStyle(Style):
  14. """
  15. This style mimics the Monokai color scheme.
  16. """
  17. name = 'monokai'
  18. background_color = "#272822"
  19. highlight_color = "#49483e"
  20. styles = {
  21. # No corresponding class for the following:
  22. Token: "#f8f8f2", # class: ''
  23. Whitespace: "", # class: 'w'
  24. Error: "#ed007e bg:#1e0010", # class: 'err'
  25. Other: "", # class 'x'
  26. Comment: "#959077", # class: 'c'
  27. Comment.Multiline: "", # class: 'cm'
  28. Comment.Preproc: "", # class: 'cp'
  29. Comment.Single: "", # class: 'c1'
  30. Comment.Special: "", # class: 'cs'
  31. Keyword: "#66d9ef", # class: 'k'
  32. Keyword.Constant: "", # class: 'kc'
  33. Keyword.Declaration: "", # class: 'kd'
  34. Keyword.Namespace: "#ff4689", # class: 'kn'
  35. Keyword.Pseudo: "", # class: 'kp'
  36. Keyword.Reserved: "", # class: 'kr'
  37. Keyword.Type: "", # class: 'kt'
  38. Operator: "#ff4689", # class: 'o'
  39. Operator.Word: "", # class: 'ow' - like keywords
  40. Punctuation: "#f8f8f2", # class: 'p'
  41. Name: "#f8f8f2", # class: 'n'
  42. Name.Attribute: "#a6e22e", # class: 'na' - to be revised
  43. Name.Builtin: "", # class: 'nb'
  44. Name.Builtin.Pseudo: "", # class: 'bp'
  45. Name.Class: "#a6e22e", # class: 'nc' - to be revised
  46. Name.Constant: "#66d9ef", # class: 'no' - to be revised
  47. Name.Decorator: "#a6e22e", # class: 'nd' - to be revised
  48. Name.Entity: "", # class: 'ni'
  49. Name.Exception: "#a6e22e", # class: 'ne'
  50. Name.Function: "#a6e22e", # class: 'nf'
  51. Name.Property: "", # class: 'py'
  52. Name.Label: "", # class: 'nl'
  53. Name.Namespace: "", # class: 'nn' - to be revised
  54. Name.Other: "#a6e22e", # class: 'nx'
  55. Name.Tag: "#ff4689", # class: 'nt' - like a keyword
  56. Name.Variable: "", # class: 'nv' - to be revised
  57. Name.Variable.Class: "", # class: 'vc' - to be revised
  58. Name.Variable.Global: "", # class: 'vg' - to be revised
  59. Name.Variable.Instance: "", # class: 'vi' - to be revised
  60. Number: "#ae81ff", # class: 'm'
  61. Number.Float: "", # class: 'mf'
  62. Number.Hex: "", # class: 'mh'
  63. Number.Integer: "", # class: 'mi'
  64. Number.Integer.Long: "", # class: 'il'
  65. Number.Oct: "", # class: 'mo'
  66. Literal: "#ae81ff", # class: 'l'
  67. Literal.Date: "#e6db74", # class: 'ld'
  68. String: "#e6db74", # class: 's'
  69. String.Backtick: "", # class: 'sb'
  70. String.Char: "", # class: 'sc'
  71. String.Doc: "", # class: 'sd' - like a comment
  72. String.Double: "", # class: 's2'
  73. String.Escape: "#ae81ff", # class: 'se'
  74. String.Heredoc: "", # class: 'sh'
  75. String.Interpol: "", # class: 'si'
  76. String.Other: "", # class: 'sx'
  77. String.Regex: "", # class: 'sr'
  78. String.Single: "", # class: 's1'
  79. String.Symbol: "", # class: 'ss'
  80. Generic: "", # class: 'g'
  81. Generic.Deleted: "#ff4689", # class: 'gd',
  82. Generic.Emph: "italic", # class: 'ge'
  83. Generic.Error: "", # class: 'gr'
  84. Generic.Heading: "", # class: 'gh'
  85. Generic.Inserted: "#a6e22e", # class: 'gi'
  86. Generic.Output: "#66d9ef", # class: 'go'
  87. Generic.Prompt: "bold #ff4689", # class: 'gp'
  88. Generic.Strong: "bold", # class: 'gs'
  89. Generic.EmphStrong: "bold italic", # class: 'ges'
  90. Generic.Subheading: "#959077", # class: 'gu'
  91. Generic.Traceback: "", # class: 'gt'
  92. }