monokai.py 4.9 KB

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