friendly_grayscale.py 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. """
  2. pygments.styles.friendly_grayscale
  3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  4. A style based on friendly style.
  5. The color values of the friendly style have been converted to grayscale
  6. using the luminosity value calculated by
  7. http://www.workwithcolor.com/color-converter-01.htm
  8. :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
  9. :license: BSD, see LICENSE for details.
  10. """
  11. from pygments.style import Style
  12. from pygments.token import Keyword, Name, Comment, String, Error, \
  13. Number, Operator, Generic, Whitespace
  14. __all__ = ['FriendlyGrayscaleStyle']
  15. class FriendlyGrayscaleStyle(Style):
  16. """
  17. A modern grayscale style based on the friendly style.
  18. .. versionadded:: 2.11
  19. """
  20. name = 'friendly_grayscale'
  21. background_color = "#f0f0f0"
  22. styles = {
  23. Whitespace: "#bbbbbb",
  24. Comment: "italic #959595",
  25. Comment.Preproc: "noitalic #575757",
  26. Comment.Special: "noitalic bg:#F4F4F4",
  27. Keyword: "bold #575757",
  28. Keyword.Pseudo: "nobold",
  29. Keyword.Type: "nobold #4F4F4F",
  30. Operator: "#666666",
  31. Operator.Word: "bold #575757",
  32. Name.Builtin: "#575757",
  33. Name.Function: "#3F3F3F",
  34. Name.Class: "bold #7E7E7E",
  35. Name.Namespace: "bold #7E7E7E",
  36. Name.Exception: "#575757",
  37. Name.Variable: "#9A9A9A",
  38. Name.Constant: "#A5A5A5",
  39. Name.Label: "bold #363636",
  40. Name.Entity: "bold #848484",
  41. Name.Attribute: "#707070",
  42. Name.Tag: "bold #3B3B3B",
  43. Name.Decorator: "bold #555555",
  44. String: "#717171",
  45. String.Doc: "italic",
  46. String.Interpol: "italic #9F9F9F",
  47. String.Escape: "bold #717171",
  48. String.Regex: "#575757",
  49. String.Symbol: "#676767",
  50. String.Other: "#7E7E7E",
  51. Number: "#888888",
  52. Generic.Heading: "bold #373737",
  53. Generic.Subheading: "bold #5A5A5A",
  54. Generic.Deleted: "#545454",
  55. Generic.Inserted: "#7D7D7D",
  56. Generic.Error: "#898989",
  57. Generic.Emph: "italic",
  58. Generic.Strong: "bold",
  59. Generic.EmphStrong: "bold italic",
  60. Generic.Prompt: "bold #7E7E7E",
  61. Generic.Output: "#888888",
  62. Generic.Traceback: "#6D6D6D",
  63. Error: "border:#898989"
  64. }