Skip to content

202_107: Fix python syntax color visibility in dark mode#2891

Open
git-lakshy wants to merge 1 commit intoMoganLab:mainfrom
git-lakshy:myb3
Open

202_107: Fix python syntax color visibility in dark mode#2891
git-lakshy wants to merge 1 commit intoMoganLab:mainfrom
git-lakshy:myb3

Conversation

@git-lakshy
Copy link
Contributor

Issue :

In the dark theme, the syntax of Python becomes difficult to see.

What

To imrpove visbility updated the Python syntax highlighting color scheme in python-lang.scm.

Color Changes:

  • Keywords: #309090 → #005CC5 (Deep Blue)
  • Constants: #4040c0 → #D73A49 (Soft Red)
  • Strings: dark grey → #22863A (Medium Green)
  • Functions: #0000c0 → #6F42C1 (Muted Purple)
  • Classes: #0000c0 → #B31D28 (Deep Red)
  • Operators: #8b008b → #E36209 (Warm Orange)
  • Brackets: #B02020 → #E36209 (Warm Orange)
  • Comments: brown → #999999 (Neutral Gray)
  • Errors: dark red → #CB2431 (Strong Red)
  • Field Operator: #88888 → #999999 (Neutral Gray)
  • Special Operators: orange → #E36209 (Warm Orange)
  • Undefined: red → #999999 (Neutral Gray)

Python syntax is better visible on both light and dark themes with improved contrast and visual distinction between different syntax elements.

Screenshots

Previous :
image

After changes :

image image

Copilot AI review requested due to automatic review settings February 27, 2026 20:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates TeXmacs’ Python plugin syntax-highlighting preference colors to improve readability/contrast in dark mode, and adds a short markdown note documenting the change.

Changes:

  • Adjust Python syntax highlighting preference colors in python-lang.scm (keywords/constants/strings/operators/comments, etc.).
  • Add a 202_107.md write-up describing the motivation and the new color scheme.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
TeXmacs/plugins/python/progs/code/python-lang.scm Updates Python syntax highlighting color preferences for better visibility (especially in dark theme).
202_107.md Adds a brief change note documenting the issue, color changes, and author/date.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

("syntax:python:keyword" "#309090" notify-python-syntax) ;; 关键字颜色
("syntax:python:keyword_conditional" "#309090" notify-python-syntax) ;; 条件关键字颜色
("syntax:python:keyword_control" "#309090" notify-python-syntax)) ;; 控制关键字颜色 No newline at end of file
("syntax:python:none" "#999999" notify-python-syntax) ;; Neutral Gray
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntax:python:none is used as the fallback color when a token type isn’t recognized by encode_color (e.g. operator_decoration such as @ is not in language.cpp’s color encoding map and therefore decodes to the none color). With this change, decorators will end up #999999 (same as comments), which reduces visual distinction. Consider mapping @ to an existing encoded operator class (like operator_special) in the Python operator feature list, or extend the core color encoding/decoding to support operator_decoration so it can have an intentional color.

Suggested change
("syntax:python:none" "#999999" notify-python-syntax) ;; Neutral Gray
("syntax:python:none" "#E36209" notify-python-syntax) ;; Warm Orange (fallback/operator-like)

Copilot uses AI. Check for mistakes.
In the dark theme, the syntax of Python becomes difficult to see.

### What
To imrpove visbility updated the Python syntax highlighting color scheme in `python-lang.scm`.
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo/grammar: “To imrpove visbility …” should be “To improve visibility …”

Suggested change
To imrpove visbility updated the Python syntax highlighting color scheme in `python-lang.scm`.
To improve visibility, updated the Python syntax highlighting color scheme in `python-lang.scm`.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants