Skip to content
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

[Feature] Get default line color from colorscheme #10

Open
FlyingWombat opened this issue Feb 26, 2019 · 2 comments
Open

[Feature] Get default line color from colorscheme #10

FlyingWombat opened this issue Feb 26, 2019 · 2 comments

Comments

@FlyingWombat
Copy link
Contributor

FlyingWombat commented Feb 26, 2019

This plugin is pretty great, but what would make it even better is if it could determine the default highlighter color from the current colorscheme's background color.
The default dark-gray works well for most dark color schemes, but is a stark contrast on light schemes.

Idea 1

A simple solution might be to just set the line highlighter color equal to StatusLine, BufferPadding, or Prompt from the colorscheme.

Idea 2

Another, more complicated way, could be to set a "turn" point between light and dark, and base the highlighter color off the Default face color.
Then increment / decrement the RGB value from the colorscheme based on which side of the turn point it is.

For example:
Set "turn" as 0x44,
Then if background is rgb:222222, add 0x11 to each pair, to make it lighter.
If background is rgb:cccccc, subtract 0x11 from each pair, to make it darker.

IDK if it would be better to decide Add vs Sub for each pair in the RGB value, or do something like average them to do the same for all three pairs.

@insipx
Copy link
Owner

insipx commented Feb 27, 2019

yeah, I've been thinking of this problem as of late too

I'll play around with some foreground/background colors and see if I can find anything that works for a majority of the colorschemes I have loaded into kak right now

@FlyingWombat
Copy link
Contributor Author

FlyingWombat commented Feb 28, 2019

I think, ideally, the line and column highlighters should just slightly increase the contrast between foreground and background. To do that, we need to know what colors the set color scheme is using, since it'll be different between light and dark schemes. But, AFAIK that isn't possible in Kakoune yet. See mawww/kakoune#736

Or, maybe the solution to this could be to add a "Default High Contrast" face to all colorschemes, that is higher contrast than default, but still has syntax highlighting.

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

No branches or pull requests

2 participants