Fisher: color choices make reading text hard on white/light themes

Created on 13 Apr 2017  Â·  11Comments  Â·  Source: jorgebucaran/fisher

pretty much impossible for me to read that 1 and OK

screen shot 2017-04-13 at 6 31 18 am

proposed change:

  • if a dark color was used as a background, also set the color of the text to a light color

currently it seems it is assumed the text color is light (that the user is using a dark theme) so there is no need to set the text color when a dark background color is set

All 11 comments

if a dark color was used as a background, also set the color of the text to a light color

Is there a way to query the console for this info?

It's a bit better with pure theme (I'm a maintainer) with base16-konsole but it's still difficult to read:
selection_039

@balupton Unfortunately this is difficult to solve because AFIK there is not way to query the console/terminal to tell you the current background color.

from my understanding, the 1st (index 0) ansi colour is meant to be dark and the 8th (index 7) ansi colour is meant to light - with dark themes inversing this

hrmmm, checking my own themes, not sure that my understanding is actually correct

Actually there is a way to check all the session properties, but it is very hacky, is via configuration settings for linux and via osascript for mac.

I have to still dig on a linux box for the linux solution, but for mac would be with this applescript if the console is the iterm2

tell application "iTerm"
    tell current window
        tell current session
            get background color
        end tell
    end tell
end tell

and this one if is a standard terminal

tell application "Terminal"
    tell startup settings
        get background color
    end tell
end tell

@Markcial This is incredible Mark!

Seems the answers on https://unix.stackexchange.com/q/245378/50703 are also a good resource

Maybe we should create a plugin for this.

We can add ways to dig for the foreground and background saturations and set environment vars to:

  • LIGHT_FG_SATURATION: when the font color has a saturation lower than the 40%
  • MID_FG_SATURATION: when the font color has a saturation in between 40% and 60%
  • HIGH_FG_SATURATION: when the font color has a saturation higher than the 60%
  • LIGHT_BG_SATURATION: when the background color has a saturation lower than the 40%
  • MID_BG_SATURATION: when the background color has a saturation in between the 40% and 60%
  • HIGH_BG_SATURATION: when the background color has a saturation higher than the 60%
  • BACKGROUND_HAS_IMAGE: when the terminal uses any image as background
  • BACKGROUND_OPACITY: with the value of the opacity set to the terminal background

Those environment vars are a draft and unprefixed, but i start the debate with that.

The ways to dig can be includes that people can write to help outperform the plugin, when there is no way to guess the information from the terminal we must think about a way to pointing up people to the plugin and how to collaborate to get their terminals, displays or emulators to give this information via a include or configuration for the plugin, i already posted the ones for iterm2 and terminal for mac, maybe we can work out more generic configurations like XTERM or so.

But the plugin should be optional, fisherman should have no dependencies, once the plugin is installed it helps with the theme setup setting light or dark foreground colors depending on the terminal saturation and background colors based on the font saturation too.

Without the plugin the actual behaviour should apply

whatever you guys think is best

@balupton My console's background is white too, so I could certainly use this. My current theme is https://github.com/fisherman/boss btw.

@Markcial I am going to close here since I don't think this has a reasonable solution.

Was this page helpful?
0 / 5 - 0 ratings