friendly_grayscale.py 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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-2023 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. class FriendlyGrayscaleStyle(Style):
  15. """
  16. A modern grayscale style based on the friendly style.
  17. .. versionadded:: 2.11
  18. """
  19. background_color = "#f0f0f0"
  20. styles = {
  21. Whitespace: "#bbbbbb",
  22. Comment: "italic #959595",
  23. Comment.Preproc: "noitalic #575757",
  24. Comment.Special: "noitalic bg:#F4F4F4",
  25. Keyword: "bold #575757",
  26. Keyword.Pseudo: "nobold",
  27. Keyword.Type: "nobold #4F4F4F",
  28. Operator: "#666666",
  29. Operator.Word: "bold #575757",
  30. Name.Builtin: "#575757",
  31. Name.Function: "#3F3F3F",
  32. Name.Class: "bold #7E7E7E",
  33. Name.Namespace: "bold #7E7E7E",
  34. Name.Exception: "#575757",
  35. Name.Variable: "#9A9A9A",
  36. Name.Constant: "#A5A5A5",
  37. Name.Label: "bold #363636",
  38. Name.Entity: "bold #848484",
  39. Name.Attribute: "#707070",
  40. Name.Tag: "bold #3B3B3B",
  41. Name.Decorator: "bold #555555",
  42. String: "#717171",
  43. String.Doc: "italic",
  44. String.Interpol: "italic #9F9F9F",
  45. String.Escape: "bold #717171",
  46. String.Regex: "#575757",
  47. String.Symbol: "#676767",
  48. String.Other: "#7E7E7E",
  49. Number: "#888888",
  50. Generic.Heading: "bold #373737",
  51. Generic.Subheading: "bold #5A5A5A",
  52. Generic.Deleted: "#545454",
  53. Generic.Inserted: "#7D7D7D",
  54. Generic.Error: "#898989",
  55. Generic.Emph: "italic",
  56. Generic.Strong: "bold",
  57. Generic.EmphStrong: "bold italic",
  58. Generic.Prompt: "bold #7E7E7E",
  59. Generic.Output: "#888888",
  60. Generic.Traceback: "#6D6D6D",
  61. Error: "border:#898989"
  62. }