lightbulb.py 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. """
  2. pygments.styles.lightbulb
  3. ~~~~~~~~~~~~~~~~~~~~~~~~~
  4. A minimal dark theme based on the Lightbulb theme for VSCode.
  5. :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
  6. :license: BSD, see LICENSE for details.
  7. """
  8. from pygments.style import Style
  9. from pygments.token import (
  10. Comment,
  11. Error,
  12. Generic,
  13. Keyword,
  14. Literal,
  15. Name,
  16. Number,
  17. Operator,
  18. Punctuation,
  19. String,
  20. Token,
  21. )
  22. COLORS = {
  23. "bg": "#1d2331",
  24. "blue_1": "#73D0FF",
  25. "gray_1": "#7e8aa1",
  26. "gray_2": "#3c4354",
  27. "gray_3": "#6e7681",
  28. "red_1": "#f88f7f",
  29. "red_2": "#3d1e20",
  30. "orange_1": "#FFAD66",
  31. "orange_2": "#F29E74",
  32. "yellow_1": "#FFD173",
  33. "white": "#d4d2c8",
  34. "magenta_1": "#DFBFFF",
  35. "green_1": "#D5FF80",
  36. "green_2": "#19362c",
  37. "cyan_1": "#95E6CB",
  38. }
  39. class LightbulbStyle(Style):
  40. """
  41. A minimal dark theme based on the Lightbulb theme for VSCode.
  42. """
  43. background_color = COLORS['bg']
  44. highlight_color = COLORS['gray_3']
  45. line_number_color = COLORS['gray_2']
  46. line_number_special_color = COLORS['gray_2']
  47. styles = {
  48. Comment: COLORS["gray_1"],
  49. Comment.Hashbang: "italic " + COLORS['red_1'],
  50. Comment.Preproc: "bold " + COLORS['orange_1'],
  51. Comment.Special: "italic " + COLORS['gray_1'],
  52. Error: COLORS['red_1'],
  53. Generic.Deleted: f"bg:{COLORS['red_2']} #f88f7f",
  54. Generic.Emph: "italic",
  55. Generic.Error: "#f88f7f",
  56. Generic.Inserted: f"bg:{COLORS['green_2']} #6ad4af",
  57. Generic.Output: COLORS['gray_1'],
  58. Generic.Strong: "bold",
  59. Generic.Traceback: COLORS['red_1'],
  60. Keyword: COLORS['orange_1'],
  61. Keyword.Constant: COLORS['orange_1'],
  62. Keyword.Declaration: COLORS['orange_1'],
  63. Keyword.Namespace: COLORS['orange_1'],
  64. Keyword.Reserved: COLORS['orange_1'],
  65. Keyword.Type: COLORS['blue_1'],
  66. Literal: COLORS['green_1'],
  67. Name: COLORS['white'],
  68. Name.Attribute: COLORS['yellow_1'],
  69. Name.Builtin: COLORS['yellow_1'],
  70. Name.Builtin.Pseudo: "#5CCFE6",
  71. Name.Class: COLORS['blue_1'],
  72. Name.Constant: COLORS['yellow_1'],
  73. Name.Decorator: "bold italic " + COLORS['gray_1'],
  74. Name.Entity: COLORS['cyan_1'],
  75. Name.Exception: COLORS['blue_1'],
  76. Name.Function: COLORS['yellow_1'],
  77. Name.Function.Magic: COLORS['yellow_1'],
  78. Name.Other: COLORS['white'],
  79. Name.Property: COLORS['yellow_1'],
  80. Name.Tag: "#5CCFE6",
  81. Name.Variable: COLORS['white'],
  82. Number: COLORS['magenta_1'],
  83. Operator: COLORS['orange_1'],
  84. Operator.Word: COLORS['orange_1'],
  85. Punctuation: COLORS['white'],
  86. String: COLORS['green_1'],
  87. String.Affix: COLORS['orange_2'],
  88. String.Doc: COLORS['gray_1'],
  89. String.Escape: COLORS['cyan_1'],
  90. String.Interpol: COLORS['cyan_1'],
  91. String.Other: COLORS['cyan_1'],
  92. String.Regex: COLORS['cyan_1'],
  93. String.Symbol: COLORS['magenta_1'],
  94. Token: COLORS['white'],
  95. }