tango.py 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. """
  2. pygments.styles.tango
  3. ~~~~~~~~~~~~~~~~~~~~~
  4. The Crunchy default Style inspired from the color palette from
  5. the Tango Icon Theme Guidelines.
  6. http://tango.freedesktop.org/Tango_Icon_Theme_Guidelines
  7. Butter: #fce94f #edd400 #c4a000
  8. Orange: #fcaf3e #f57900 #ce5c00
  9. Chocolate: #e9b96e #c17d11 #8f5902
  10. Chameleon: #8ae234 #73d216 #4e9a06
  11. Sky Blue: #729fcf #3465a4 #204a87
  12. Plum: #ad7fa8 #75507b #5c35cc
  13. Scarlet Red:#ef2929 #cc0000 #a40000
  14. Aluminium: #eeeeec #d3d7cf #babdb6
  15. #888a85 #555753 #2e3436
  16. Not all of the above colors are used; other colors added:
  17. very light grey: #f8f8f8 (for background)
  18. This style can be used as a template as it includes all the known
  19. Token types, unlike most (if not all) of the styles included in the
  20. Pygments distribution.
  21. However, since Crunchy is intended to be used by beginners, we have strived
  22. to create a style that gloss over subtle distinctions between different
  23. categories.
  24. Taking Python for example, comments (Comment.*) and docstrings (String.Doc)
  25. have been chosen to have the same style. Similarly, keywords (Keyword.*),
  26. and Operator.Word (and, or, in) have been assigned the same style.
  27. :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
  28. :license: BSD, see LICENSE for details.
  29. """
  30. from pygments.style import Style
  31. from pygments.token import Keyword, Name, Comment, String, Error, \
  32. Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
  33. __all__ = ['TangoStyle']
  34. class TangoStyle(Style):
  35. """
  36. The Crunchy default Style inspired from the color palette from
  37. the Tango Icon Theme Guidelines.
  38. """
  39. name = 'tango'
  40. background_color = "#f8f8f8"
  41. styles = {
  42. # No corresponding class for the following:
  43. #Text: "", # class: ''
  44. Whitespace: "#f8f8f8", # class: 'w'
  45. Error: "#a40000 border:#ef2929", # class: 'err'
  46. Other: "#000000", # class 'x'
  47. Comment: "italic #8f5902", # class: 'c'
  48. Comment.Multiline: "italic #8f5902", # class: 'cm'
  49. Comment.Preproc: "italic #8f5902", # class: 'cp'
  50. Comment.Single: "italic #8f5902", # class: 'c1'
  51. Comment.Special: "italic #8f5902", # class: 'cs'
  52. Keyword: "bold #204a87", # class: 'k'
  53. Keyword.Constant: "bold #204a87", # class: 'kc'
  54. Keyword.Declaration: "bold #204a87", # class: 'kd'
  55. Keyword.Namespace: "bold #204a87", # class: 'kn'
  56. Keyword.Pseudo: "bold #204a87", # class: 'kp'
  57. Keyword.Reserved: "bold #204a87", # class: 'kr'
  58. Keyword.Type: "bold #204a87", # class: 'kt'
  59. Operator: "bold #ce5c00", # class: 'o'
  60. Operator.Word: "bold #204a87", # class: 'ow' - like keywords
  61. Punctuation: "bold #000000", # class: 'p'
  62. # because special names such as Name.Class, Name.Function, etc.
  63. # are not recognized as such later in the parsing, we choose them
  64. # to look the same as ordinary variables.
  65. Name: "#000000", # class: 'n'
  66. Name.Attribute: "#c4a000", # class: 'na' - to be revised
  67. Name.Builtin: "#204a87", # class: 'nb'
  68. Name.Builtin.Pseudo: "#3465a4", # class: 'bp'
  69. Name.Class: "#000000", # class: 'nc' - to be revised
  70. Name.Constant: "#000000", # class: 'no' - to be revised
  71. Name.Decorator: "bold #5c35cc", # class: 'nd' - to be revised
  72. Name.Entity: "#ce5c00", # class: 'ni'
  73. Name.Exception: "bold #cc0000", # class: 'ne'
  74. Name.Function: "#000000", # class: 'nf'
  75. Name.Property: "#000000", # class: 'py'
  76. Name.Label: "#f57900", # class: 'nl'
  77. Name.Namespace: "#000000", # class: 'nn' - to be revised
  78. Name.Other: "#000000", # class: 'nx'
  79. Name.Tag: "bold #204a87", # class: 'nt' - like a keyword
  80. Name.Variable: "#000000", # class: 'nv' - to be revised
  81. Name.Variable.Class: "#000000", # class: 'vc' - to be revised
  82. Name.Variable.Global: "#000000", # class: 'vg' - to be revised
  83. Name.Variable.Instance: "#000000", # class: 'vi' - to be revised
  84. # since the tango light blue does not show up well in text, we choose
  85. # a pure blue instead.
  86. Number: "bold #0000cf", # class: 'm'
  87. Number.Float: "bold #0000cf", # class: 'mf'
  88. Number.Hex: "bold #0000cf", # class: 'mh'
  89. Number.Integer: "bold #0000cf", # class: 'mi'
  90. Number.Integer.Long: "bold #0000cf", # class: 'il'
  91. Number.Oct: "bold #0000cf", # class: 'mo'
  92. Literal: "#000000", # class: 'l'
  93. Literal.Date: "#000000", # class: 'ld'
  94. String: "#4e9a06", # class: 's'
  95. String.Backtick: "#4e9a06", # class: 'sb'
  96. String.Char: "#4e9a06", # class: 'sc'
  97. String.Doc: "italic #8f5902", # class: 'sd' - like a comment
  98. String.Double: "#4e9a06", # class: 's2'
  99. String.Escape: "#4e9a06", # class: 'se'
  100. String.Heredoc: "#4e9a06", # class: 'sh'
  101. String.Interpol: "#4e9a06", # class: 'si'
  102. String.Other: "#4e9a06", # class: 'sx'
  103. String.Regex: "#4e9a06", # class: 'sr'
  104. String.Single: "#4e9a06", # class: 's1'
  105. String.Symbol: "#4e9a06", # class: 'ss'
  106. Generic: "#000000", # class: 'g'
  107. Generic.Deleted: "#a40000", # class: 'gd'
  108. Generic.Emph: "italic #000000", # class: 'ge'
  109. Generic.Error: "#ef2929", # class: 'gr'
  110. Generic.Heading: "bold #000080", # class: 'gh'
  111. Generic.Inserted: "#00A000", # class: 'gi'
  112. Generic.Output: "italic #000000", # class: 'go'
  113. Generic.Prompt: "#8f5902", # class: 'gp'
  114. Generic.Strong: "bold #000000", # class: 'gs'
  115. Generic.EmphStrong: "bold italic #000000", # class: 'ges'
  116. Generic.Subheading: "bold #800080", # class: 'gu'
  117. Generic.Traceback: "bold #a40000", # class: 'gt'
  118. }