chroma icon indicating copy to clipboard operation
chroma copied to clipboard

Styles with no text color

Open walles opened this issue 2 years ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the bug

A number of styles have Background color without any foreground spec, and no Text color either.

For example, what should the plain text color be in this style?

~/s/chroma (master|✔) $ cat styles/igor.xml
<style name="igor">
  <entry type="Background" style="bg:#ffffff"/>
  <entry type="Keyword" style="#0000ff"/>
  <entry type="NameClass" style="#007575"/>
  <entry type="NameDecorator" style="#cc00a3"/>
  <entry type="NameFunction" style="#c34e00"/>
  <entry type="LiteralString" style="#009c00"/>
  <entry type="Comment" style="italic #ff0000"/>
</style>⏎
~/s/chroma (master|✔) $

As suggested in #867, I tried to extract the Background color (success!) and write text on it.

However, when the foreground color is undefined, this can give me white text on white background, which is unreadable.

More or less related to #212.

To Reproduce

List of styles with Background set but no Text.

~/s/chroma (master|✔) $ grep Background styles/*.xml | grep bg: | grep -E -v 'style=".* .*"' | cut -d: -f1 | xargs grep -L '"Text"'
styles/abap.xml
styles/algol.xml
styles/algol_nu.xml
styles/arduino.xml
styles/autumn.xml
styles/borland.xml
styles/bw.xml
styles/colorful.xml
styles/emacs.xml
styles/friendly.xml
styles/github.xml
styles/igor.xml
styles/lovelace.xml
styles/manni.xml
styles/murphy.xml
styles/pastie.xml
styles/perldoc.xml
styles/tango.xml
styles/trac.xml
styles/vs.xml
styles/xcode.xml
~/s/chroma (master|✔) $

walles avatar Dec 18 '23 20:12 walles