dracula.py 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. """
  2. pygments.styles.dracula
  3. ~~~~~~~~~~~~~~~~~~~~~~~
  4. Pygments version of `Dracula` from https://github.com/dracula/dracula-theme.
  5. Based on the Dracula Theme for pygments by Chris Bracco.
  6. See https://github.com/dracula/pygments/tree/fee9ed5613d1086bc01b9d0a5a0e9867a009f571
  7. :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
  8. :license: BSD, see LICENSE for details.
  9. """
  10. from pygments.style import Style
  11. from pygments.token import Keyword, Name, Comment, String, Error, Literal, \
  12. Number, Operator, Other, Punctuation, Text, Generic, Whitespace
  13. __all__ = ['DraculaStyle']
  14. background = "#282a36"
  15. foreground = "#f8f8f2"
  16. selection = "#44475a"
  17. comment = "#6272a4"
  18. cyan = "#8be9fd"
  19. green = "#50fa7b"
  20. orange = "#ffb86c"
  21. pink = "#ff79c6"
  22. purple = "#bd93f9"
  23. red = "#ff5555"
  24. yellow = "#f1fa8c"
  25. deletion = "#8b080b"
  26. class DraculaStyle(Style):
  27. name = 'dracula'
  28. background_color = background
  29. highlight_color = selection
  30. line_number_color = yellow
  31. line_number_background_color = selection
  32. line_number_special_color = green
  33. line_number_special_background_color = comment
  34. styles = {
  35. Whitespace: foreground,
  36. Comment: comment,
  37. Comment.Preproc: pink,
  38. Generic: foreground,
  39. Generic.Deleted: deletion,
  40. Generic.Emph: "underline",
  41. Generic.Heading: "bold",
  42. Generic.Inserted: "bold",
  43. Generic.Output: selection,
  44. Generic.EmphStrong: "underline",
  45. Generic.Subheading: "bold",
  46. Error: foreground,
  47. Keyword: pink,
  48. Keyword.Constant: pink,
  49. Keyword.Declaration: cyan + " italic",
  50. Keyword.Type: cyan,
  51. Literal: foreground,
  52. Name: foreground,
  53. Name.Attribute: green,
  54. Name.Builtin: cyan + " italic",
  55. Name.Builtin.Pseudo: foreground,
  56. Name.Class: green,
  57. Name.Function: green,
  58. Name.Label: cyan + " italic",
  59. Name.Tag: pink,
  60. Name.Variable: cyan + " italic",
  61. Number: orange,
  62. Operator: pink,
  63. Other: foreground,
  64. Punctuation: foreground,
  65. String: purple,
  66. Text: foreground,
  67. }