Add Eclipse-Light style#2440
Add Eclipse-Light style#2440kathy239 wants to merge 0 commit intopygments:masterfrom kathy239:Eclipse_LightStyle
Conversation
Anteru
left a comment
There was a problem hiding this comment.
I agree, that dictionary should be sorted, but I'll do it afterwards to not pollute this PR with unrelated changes.
pygments/styles/eclipse.py
Outdated
| BLUE_COMMENT = "#3F5FBF" | ||
| GREEN_COMMENT = "#3F7F5F" | ||
| BLACK = "#000000" | ||
|
|
There was a problem hiding this comment.
Can you also please set:
line_number_color
line_number_background_color
line_number_special_color
line_number_special_background_color
highlight_color
In addition to background_color, so you're not getting defaults that may or may not work for this? I suspect there's a particular highlight color you want to use for Eclipse?
There was a problem hiding this comment.
I remember Eclipse Light style use white as the background colour. Then, the default colour "#f8f8f8" should be alright. I thought white should be "#ffffff" as that is the result I got from Google.
Do you need me to just change the background_color to default? I think that default colour looks better.
I have already added the line number related stuff.

There was a problem hiding this comment.
Thanks for adding the other colors!
It's your style -- all I'm saying is the default colors might change one day, and hence I'd prefer if new styles define all colors we support to ensure they continue to work if we ever decide that the default should be bright pink. We haven't been paying much attention to this previously and it's yet another item on my todo list to automatically check this :(
There was a problem hiding this comment.
I get it now. Thanks for your reply!
I think it's a good idea to keep my style not having too much adherent with the default settings.
I have already added the missing copyright header to the file. Now I am working on the contrast issue that @jeanas mentioned
Seems like my style failed a test due to not having enough contrast. Does that mean I need more "black&white" stuff to make my style more readable? Seems like whatever I try to edit the style and run the test_contrasts.py, I would only get the following error.
"AssertionError: contrast degradation for style 'eclipse'
The following rules have a contrast lower than the required 4.5:
- 3.80 Token.Error"
There was a problem hiding this comment.
Contrast is the minimum of contrasts for all tokens. In this case, you have to change the color of Error tokens to have a higher contrast with the white background (i.e., choose a darker color).
There was a problem hiding this comment.
It's no problem to have failing tests on a PR — to the contrary, we can help you figure out how to fix them and/or push commits ourselves to fix them.
Thanks for your help && reply
Hi, I changed the error to even darker colour like matte black. Seems like that number increased from 3.8 to 4.0! I probably need to tweak a few more colours to make my style a bit more readable.
|
There are CI failures.
|
|
I just want to close it for now to keep the code clean. I am a newbie who is not quite familiar with the workflow. I think I need to pass all tests on my forked repo first before massing up with a pull request. Thanks. |
|
It's no problem to have failing tests on a PR — to the contrary, we can help you figure out how to fix them and/or push commits ourselves to fix them. |
Reference : Syntax_Highlighting.

The test result:
Also, I suggest that we should sort the STYLE_MAP dictionary in alphabet order. I could quickly do it if everyone thinks it's a good idea.
Thanks xD