New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Insufficient contrast when running code with error #894
Comments
IPython has an option to configure the colour scheme, see |
I'd like to have a way to override these for the sake of nteract as well, similar to how it's done in iTerm2. We currently just interpret ANSI codes as is for |
Part of the problem here is that we cannot easily get the colors used by the current Atom theme (at least I don't know of any good way). We only have access to the official syntax colors. |
Could/does If not, it could be enhanced to do so I think. Anser has the option:
We could style these classes in |
I'd certainly be in favor of having class name support for ansi-to-react. |
Do we have a way to get the syntax colors from the Atom color theme? If I recall correctly they aren't exposed anywhere. |
@lgeiger i'm just talking about the ones from For example |
For now you might consider adding this to your styles.less
|
I like the suggestion of @BenRussert, though we wouldn't ensure that the colors aren't mixed up when using different themes. But at least they would match the overall color schema and have enough contrast.
|
@n-riesco where and how can I configure IPython / Hydrogen to for example disable syntax highlighting in stack traces? Though CSS-configurable color scheme would be very nice. |
@mattiasarro The IPython kernel provides a small number of color schemes (see here). The one you want to use with dark backgrounds is named If you're happy editing the kernel spec installed in your machine, you could do so like this:
The CSS route, judging by the comments above, would be a bit more involved. |
@bigheadming Check the above issue out related to error message backgrounds you mentioned. |
Thanks @BenRussert. However, it does not change after I added "--colors='Linux'" to my kernel.json. The color is still the same: { There is a bit difference between my kernel.json and @n-riesco 's. His 3rd argument is "ipykernel" while mine is "ipykernel_launcher". May be that's the reason mine it doesn't apply to my case. Thanks but do not work in my case :( You mentioned about ansi-to-react, however I'm not sure what to do and where to do. Could you please show more? Thanks |
I think I found a solution. In my case, --colors='Linux' does not work, but --colors='NoColor' work. Now all error messages have no color (ie white), and I can change the background color to black. |
After trying a lot with ipython themes and stuff I came back to @jasonleonhard 's solution and did a bit of refinement. I added this to my styles to overwrite the blue colored spans with a color fitting for my theme:
|
Is there no way to just use
...and so on, based on what IPython uses those for? Also, basically, there's also the possibility to highlight the output in the plugin rather than translating those ANSI colors, right? |
Hi, i was not able to apply @andreas-wolf suggested , it didn't change the blue color, may be i didnt put in the right place in the style.less. can you help me how to change the blue color when i have an error. |
@hefayed your styles.less is located by opening atom, clicking |
@hefayed the CSS you need to apply on newer versions of hydrogen is
That's because apparently hydrogen has changed the HTML classes and nesting, so the one based on On MacOS go to "Atom" menu and select "Stylesheet...", (or "File > Stylesheet..." on other operating systems) and paste the line in there. If the above stops working, you can find out the new CSS selector by using the Developer Tools (View > Developer > Toggle Developer Tools) and use the element inspector (arrow button on the top left of the Developer Tools). With the element inspector you can click on the HTML tag that contains the blue text and see what's its class name / CSS selector. |
@mattiasarro thanks allot it worked nicely , thank you for detailed explanation and for the pointer for developer tools. |
@mattiasarro This does not change anything for me. As I read it, this should change the dark blue to light blue, right? My styles.less is empty except for that one line of yours. Do I have to load anything else? (MacOS 10.14.6, Atom 1.46.0 x64, Hydrogen 2.14.1). Thanks heaps! |
@schmidtlennart there's a good chance Hydrogen has changed the HTML structure / classes again. I don't use Atom anymore (discovered that VSCode has almost all the good parts of Atom + many other nice aspects that Atom doesn't) so I can't check it out myself, but you can try to find out what's the right CSS rule you need to apply based on the second part of my suggestion: If the above stops working, you can find out the new CSS selector by using the Developer Tools (View > Developer > Toggle Developer Tools) and use the element inspector (arrow button on the top left of the Developer Tools). With the element inspector you can click on the HTML tag that contains the blue text and see what's its class name / CSS selector. Also you may need to restart your editor after you apply new styles. |
Apologies if this is a necro, but I was able to get it working using: This applies a lighter blue that's a bit easier on the eyes ;) |
Description:
Insufficient contrast with dark color schemes when running code with error makes it hard to read the error message.
Error messages should use the Atom syntax scheme or use a white background or other background color to increase contrast.
Steps to Reproduce:
Versions:
Which OS and which version of Hydrogen and Atom are you running?
Atom : 1.18.0
Electron: 1.3.15
Chrome : 52.0.2743.82
Node : 6.5.0
You can get this information from copy and pasting the output of
atom --version
from the command line.Logs:
N / A
Please post any error logs and the output of the developer tools as described in our Debugging Guide.
The text was updated successfully, but these errors were encountered: