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

Kanagawa light mode #13

Closed
Kypert opened this issue Dec 29, 2021 · 38 comments
Closed

Kanagawa light mode #13

Kypert opened this issue Dec 29, 2021 · 38 comments

Comments

@Kypert
Copy link

Kypert commented Dec 29, 2021

Hi, I am currently enjoying the dark colorscheme, just wondering if there are any plans regarding a light mode for those sunny days?

@rebelot
Copy link
Owner

rebelot commented Dec 29, 2021

yes my friend. I have recently added the support for themes, so expect more to come :)

@JSchrtke
Copy link

Are you working on this? If not, I would give it a shot based on the color palette you use for the dark theme.

@rebelot
Copy link
Owner

rebelot commented Apr 18, 2022

Hi! Yes it's been some time. I am not currently working on this, but I have playing with kanagawa.themes in my todo list. If you want to experiment with this, I'd suggest adding a new theme. The names in the default themes are the ones required to setup the highlights

@JSchrtke
Copy link

Yeah, I've played around a bit earlier. Creating a light theme with the existing palette is proving a bit tricky though, because lot's of the colors in there are lacking a bit of contrast on a bright background.

I'll play around some more; once I get something I'm happy with I'll leave you a pull request.

@sseneca
Copy link

sseneca commented Aug 3, 2022

Any progress on this? I've found myself wanting it more and more as of late :)

@bakunowski
Copy link

I've been playing around with a light mode recently. Here are the results:
Screenshot 2022-08-03 at 19 41 33

Curious to hear if this is what others envisioned for the light version of this theme.

@JSchrtke
Copy link

JSchrtke commented Aug 3, 2022

I'm not sure what I "envisioned", but I sure gave it a good try. My original idea was to keep the original palette, and just use those colours to make a light theme, but I had many issues with contrast.
So I started adding more colors that kinda "looked right". But at some point I felt I was making a new theme, and I did not want to just make something that wasn't up to the original authors idea/inspiration of the great wave painting. I shelved it at some point. Just had a look again, this was the last I came up with:

image

Edit: Also, I tried to make this have high contrast, so you can actually read stuff in brightly lit situations. Tell me what you think @rebelot, I might pick this back up

@rebelot
Copy link
Owner

rebelot commented Aug 4, 2022

That isn't bad at all! After some experiments my idea is the following:

  • Invert bg and fg
  • Use the same tints of colors for syntax elements but adjust their luminance in HSL
  • add the missing white/gray shades for UI elements

Now I'm just wondering if it's worth it to include an HSL module and handle shading on the fly or just add the new colors (maybe with a bit of name refactoring)

@JSchrtke
Copy link

JSchrtke commented Aug 9, 2022

Sorry for the slow responses, pretty busy atm. Im gonna give this another go and start fresh, with the same colors I already played with. Though its probably gonna be a while, as said, Im kinda busy at the moment.

@rebelot
Copy link
Owner

rebelot commented Aug 9, 2022

still need serious tweakings but that's the general idea.

Screenshot 2022-08-09 at 12 37 59

@sseneca
Copy link

sseneca commented Aug 16, 2022

That looks pretty good! When are you thinking of releasing it? Maybe it could be on a separate branch for now, so people could opt-in to test it for a while :)

Or that may be unnecessary as it's enabled/disabled by the user anyway

@mavam
Copy link

mavam commented Aug 16, 2022

Honestly, merging something is better than nothing. Even though it ain't pretty enough, I'd rather stay outside than go inside just because I don't have a light colorscheme. 😉

@rebelot
Copy link
Owner

rebelot commented Aug 16, 2022

fair enough, I am working on it atm but for now it has its own slightly outdated branch https://github.com/rebelot/kanagawa.nvim/tree/light_theme

@sseneca
Copy link

sseneca commented Aug 16, 2022

Which option do I need to set to use it? I have that branch checked out

@rebelot
Copy link
Owner

rebelot commented Aug 16, 2022

Which option do I need to set to use it? I have that branch checked out

add theme = "light" option to your setup config

@rebelot
Copy link
Owner

rebelot commented Aug 16, 2022

light_theme branch has been deleted, please update to see a first attempt on light theme on master. Expect some (many) changes in the near future. I hope you can enjoy it :)

@mavam
Copy link

mavam commented Aug 16, 2022

Is there a way to dump the color hexcodes for the light scheme? I realized that I also need to update my Kitty theme for it to be useful.

@rebelot
Copy link
Owner

rebelot commented Aug 16, 2022

Is there a way to dump the color hexcodes for the light scheme? I realized that I also need to update my Kitty theme for it to be useful.

:lua =require"kanagawa.themes".light(require"kanagawa.colors".setup({theme = "light"}))

@mavam
Copy link

mavam commented Aug 17, 2022

Thanks, got it to work:

image

image

image

Here's the theme file I used for Fish:

## name: Kanagawa-Light
## license: MIT
## author: Matthias Vallentin


background #f2eccd
foreground #3b3b4c
selection_background #c8cfd9
selection_foreground #16161D
url_color #72A7BC
cursor #16161D

# Tabs
active_tab_background #c8cfd9
active_tab_foreground #3b3b4c
inactive_tab_background #b3bac4
inactive_tab_foreground #727169
#tab_bar_background #15161E

# normal
color0 #090618
color1 #C34043
color2 #76946A
color3 #69542e
color4 #284683
color5 #493764
color6 #4a6860
color7 #16161D

# bright
color8  #727169
color9  #aa1212
color10 #4d652f
color11 #725217
color12 #295364
color13 #938AA9
color14 #5d5573
color15 #3b3b4c

# extended colors
color16 #FFA066
color17 #FF5D62

I went through the original (dark) file and looked for the hex codes in the output of the command you posted, @rebelot. There are still some bugs in the Kitty theme (per the neofetch output), but it's a start.

@sseneca
Copy link

sseneca commented Aug 18, 2022

Shall I use this thread to discuss issues I've noticed with the light theme, or shall I create new issues for each?

@rebelot
Copy link
Owner

rebelot commented Aug 18, 2022

Doesn't really matter. Please address the issues you have found

@sseneca
Copy link

sseneca commented Aug 19, 2022

There are a couple things, I don't have time to list them right now but the main issue I've noticed is that some colours seem incorrect, e.g. this is what fzf-lua's picker looks like:

Screenshot 2022-08-19 at 10 19 49

Same happens in Kitty using fzf:

Screenshot 2022-08-19 at 10 21 29

This is much less jarring in the dark version of the theme:

Screenshot 2022-08-19 at 10 22 34

@rebelot
Copy link
Owner

rebelot commented Aug 19, 2022

this is due to fzf color scheme, I think you should use fzf --color=light. See https://github.com/junegunn/fzf/wiki/Color-schemes

@sseneca
Copy link

sseneca commented Aug 19, 2022

Hmm, that looks a bit better, but still not as good as the dark theme? Unless it's meant to look like that, and I'm just not used to it...

Screenshot 2022-08-19 at 14 39 25

@rebelot
Copy link
Owner

rebelot commented Aug 19, 2022

Screenshot 2022-08-19 at 18 10 26

Screenshot 2022-08-19 at 18 10 03

one is gruvbox (light hard), the other is kanagawa. I think many colors in FZF are hardcoded and have nothing to do with the colorscheme, although, as usual, dark schemes tend to look better.

@strash
Copy link

strash commented Aug 30, 2022

Hi!
Are there any plans to implement theme selection with vim.opt.background = "light"/"dark?

@rebelot
Copy link
Owner

rebelot commented Aug 31, 2022

Hi! Are there any plans to implement theme selection with vim.opt.background = "light"/"dark?

done, looks like a god idea:)

@DMunkei
Copy link

DMunkei commented Sep 12, 2022

Is there a way to toggle between the dark and light mode? I set the background using :set background=light

I'm using Alacritty with zsh, when I open a window for example like telescope, the theme is adjusted. However, when I'm inside of a buffer the old theme is still active...?
The Preview window shows the file colours.lua correctly rendered
image
When I load it into the buffer, it's back to the dark theme
image

Thanks for your help people :)

@rebelot
Copy link
Owner

rebelot commented Sep 12, 2022

sorry but I can't reproduce... do you have any plugins that might interfere with colorschemes? did you hardcode kanagawa highlights anywhere?

@DMunkei
Copy link

DMunkei commented Sep 12, 2022

No I haven't hard coded colorschemes anywhere. This is my color file

vim.opt.laststatus = 3
vim.opt.fillchars:append({
    horiz = '━',
    horizup = '┻',
    horizdown = '┳',
    vert = '┃',
    vertleft = '┨',
    vertright = '┣',
    verthoriz = '╋',
})

require('kanagawa').setup({
    undercurl = true,           -- enable undercurls
    commentStyle = { italic = true },
    functionStyle = {},
    keywordStyle = { italic = true},
    statementStyle = { bold = true },
    typeStyle = {},
    variablebuiltinStyle = { italic = true},
    specialReturn = true,       -- special highlight for the return keyword
    specialException = true,    -- special highlight for exception handling keywords
    transparent = true,        -- do not set background color
    dimInactive = true,        -- dim inactive window `:h hl-NormalNC`
    globalStatus = true,       -- adjust window separators highlight for laststatus=3
    terminalColors = true,      -- define vim.g.terminal_color_{0,17}
    colors = {},
    overrides = {},
    theme = "default"           -- Load "default" theme or the experimental "light" theme
})

vim.cmd("colorscheme kanagawa")

The problem is after I swap from dark to white. The buffer remains in dark mode, but if I open a new buffer and it's currently active, it renders using the dark theme.

image

The last picture I'm inside of the right buffer, and the left buffer is using the light theme...

@rebelot
Copy link
Owner

rebelot commented Sep 12, 2022

I just noticed you are using transparent background and dimInactive feature. For this you must also set an appropriate background for your terminal theme, as the current buffer has no background (what you see is your terminal background color)

@DMunkei
Copy link

DMunkei commented Sep 14, 2022

Ah okay, I'm pretty much a noob here, how do I see the background? What would be appropriate here?

@rebelot
Copy link
Owner

rebelot commented Sep 14, 2022

Either remove the transparency option or set an appropriate theme for the terminal

@DMunkei
Copy link

DMunkei commented Sep 14, 2022

That worked, by setting the transparency to false. I have a question about the dragon theme. Is it possible to try now? I set 'dragon' in the theme field, but didn't notice any change.

@rebelot
Copy link
Owner

rebelot commented Sep 14, 2022

@DMunkei you need to unset the background option to change to a theme different than default or light

@DMunkei
Copy link

DMunkei commented Sep 14, 2022

Silly question, but how do I unset the background? I tried doing :set background="" but that did nothing.

Or is this the dragon theme?

image

@dzintars
Copy link

dzintars commented Nov 23, 2022

image
I would say that comment and/or listchar wants a little bit more contrast or different colors. Kind of blends together. Or it's just a bad choice of tab character.

@Kypert
Copy link
Author

Kypert commented Mar 11, 2023

Hey @rebelot, I saw a lot of commotion about breaking changes, so I took the time to update and realized I should step by here and let you know that I have happily been rocking the light/lotus variant for months now. So feel free to close this ticket, unless you have more modifications in mind :)

@rebelot rebelot closed this as completed Mar 26, 2023
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

9 participants