gerardbm / vim-atomic

Atomic color scheme for Vim, Neovim and Gvim
https://github.com/gerardbm/atomic
MIT License
16 stars 1 forks source link

Undefined variable: s:base4 #7

Closed Karmenzind closed 1 year ago

Karmenzind commented 1 year ago

My configuration:

let g:atomic_mode = 7  " night soft
let g:atomic_italic = 1
let g:atomic_bold = 1
let g:atomic_underline = 1
let g:atomic_undercurl = 1

image

gerardbm commented 1 year ago

Hi, @Karmenzind!

I did some changes in february. Is it happening since the last update? (Have you been using the same config last month?)

gerardbm commented 1 year ago

I found the bug. Update the plugin and check if it works now.

BTW, keep in mind that modes are different now. I removed the cyan and red modes, and added more contrast options for the other modes. Space mode is dark with blue hue; Night mode is dark with orange hue; Light mode is light with orange hue. You can use one of this commands for GUI:

Or alternatively you can use a combination of this:

let g:atomic_mode = 6 | set background=dark

Modes 1 to 6 with background=dark; modes 7 to 9 with background=light.

Karmenzind commented 1 year ago

The new version works fine. Thanks for your job. I've been using this colorscheme for years.

I removed the cyan and red modes, and added more contrast options for the other modes.

I love the red mode :cry:

gerardbm commented 1 year ago

@Karmenzind, ok! Since I recalculated the colors with new scripts, I can easily create modes, so I will update vim-atomic to recover the red and the cyan modes; and I will probably add modes for green and purple colors ;)

Karmenzind commented 1 year ago

hahaha thanks!

gerardbm commented 1 year ago

Done! Now Atomic comes with 7 modes: 6 dark and 1 light.

Dark modes use a hue color every 60°:

Each mode has 3 contrasts:

For the red color you can use the modes 7 (HC), 8 (MC) and 9 (LC).

Karmenzind commented 1 year ago

Thanks a lot! Already updated :smile:

gerardbm commented 1 year ago

Hi @Karmenzind

I'm planning to change the base4 color, increasing the lightness at 75% (+7% more) and reducing the saturation at 20% (-10%). Do you also think it needs more lightness and less saturation? I probably need to test it in more screens.

For example, comparison between before and after this change:

before

after

What do you think about it?

gerardbm commented 1 year ago

I'm testing colors in two BenQ monitors and I still see the base4 quite good at 68% of lightness.

I liked the idea of having all the accent colors with the same contrast (65% and 68% respectively). However, base4 is important enough to have more lightness than others.

For example, I see it more useful when the most part of the text is not coding, like a website in w3m, or writing a markdown file, and it's the most used in the most cli-tools.

So I will think about it for some time.

Karmenzind commented 1 year ago

Hi Gerard Personally I prefer the warmer theme. At first sight the 68% one looks more comfortable for me. But I'm not sure if it suits for coding. Maybe you should post a coding screenshot including various colors. After all it's what the theme mainly used for.

P.S. I usually change the theme according to the time and the room light. I wrote a function to choose random scheme every time I open the editor. As you can see, tokyonight and github provide several colorscheme options to set mode.

function! RandomSetColo(themes)
  let choosen_colo = a:themes[rand() % len(a:themes)]
  call SetColorScheme(choosen_colo)
endfunction

call RandomSetColo([
      \'NeoSolarized',
      \'atomic',
      \'blue-moon',
      \'boo',
      \'gruvbox',
      \'github_dark_default',
      \'github_light_default',
      \'nord',
      \'kat.nvim',
      \'kat.nwim',
      \'bluloco',
      \'tokyonight-night',
      \'tokyonight-storm',
      \'tokyonight-day',
      \'tokyonight-moon',
      \])

I don't know much about the mechanism of colorscheme. Is it possible/convenient for atomic to create options (for example atomic-blood, atomic-space, or more detailed atomic-blood-hc) like this? Then I can directly add them to this list without writing another function to shuffle atomic modes.

gerardbm commented 1 year ago

Ohh, I'm going to study this. I added 21 commands (AtomicBloodHC, AtomicLightLC, etc), but this way seems interesting as well.

About the colors, I think it would be good to change the 68% to only 70% for the light colors (10-16), add then +5% saturation, so they are easier to differenciate. The effect is that the dark colors and the bright colors have only a 5% of lightness difference and they are warm enough.

Then I reduce the saturation of the base colors to be more "readable" (-5% background, -15% base4). That's because if base4 has too much color, it seems that it loses contrast, even when it's the same, because the same saturation has this optical effect. So, saturarions were 30% and now would be:

There's not a lof of difference, but base4 looks more "white" and it seems to have a better contrast when it's the same (70%).

For example, before and after: before after

At the moment I'm improving the scripts to propagate the changes in one command xD

Edit: I improved the comment; this morning I didn't want to be late at job (I was in a hurry).

gerardbm commented 1 year ago

Comparing the values (relative luminance) with the old-atomic colors calculated with old algorithms, the bright colors were too bright (a relative luminance about 0.45), while dark colors were too dark (a relative luminance about 0.27).

With the new algorithms (hsluv), the relative luminance is 0.40 for the bright colors (-0.05) and 0.34 for the dark colors (+0.07). That means a Lightness of 70% for the bright colors and 65% for the dark colors. They have a contrast very similar and at the same time they are easy to differentiate.

This 70% is still darker than the old atomic bright colors. The test with 75% was too bright (relative luminance of 0.48, so it was brighter than the old atomic base4 color); I'm agree with you that it was too bright.

In resume, this color correction is balancing the contrast between dark and bright colors while keeping them easy to differentiate.

Karmenzind commented 1 year ago

Sorry for the late. Too busy these days looking for new job :( The second picture looks more clear but a bit cold. I might prefer the first one. Maybe I am just too used to low contrast mode. So sorry that I can't give you more helpful feedback because these parameter details are too complicated for me and I'm not really sensitive to colors. :joy: BTW do you have any plan to create a light green mode (like RGB 199/237/204)?

gerardbm commented 1 year ago

Well, I'm not planning to do more than 1 light scheme, but if you want you could copy the script hsluv-pal-light-mc.py to hsluv-pal-green-md.py to make a different version. You only will need to install hsluv with pip (I used pip3.8), modify the base color (BA = 60) to BA = 120 (60 is orange, 120 is green). You should have to modify the output filenames to not overwrite the others, as a result, you get a values file, a new image with the colors, and values for the .Xresoures file:

Id Color            Hue   Sat   Luv    Hex    (R - G - B)
-- --------------  ----  ----  ----  -------  -----------
01 Base 1          120°   70%   94%  #CDFABF  205 250 191
09 Base 2          120°   70%   92%  #B9F9A3  185 249 163
08 Base 3          120°   27%   30%  #3E4A3B   62  74  59
16 Base 4          120°   43%   50%  #617F58   97 127  88
-- --------------  ----  ----  ----  -------  -----------
02 Dark Red          0°  100%   40%  #BC004F  188   0  79
04 Dark Orange      60°  100%   40%  #775A00  119  90   0
03 Dark Green      120°  100%   40%  #306B00   48 107   0
07 Dark Cyan       180°  100%   40%  #006A62    0 106  98
05 Dark Blue       240°  100%   40%  #006492    0 100 146
06 Dark Violet     300°  100%   40%  #A400B6  164   0 182
-- --------------  ----  ----  ----  -------  -----------
10 Light Red         0°  100%   50%  #EA0064  234   0 100
12 Light Orange     60°  100%   50%  #957200  149 114   0
11 Light Green     120°  100%   50%  #3F8700   63 135   0
15 Light Cyan      180°  100%   50%  #00867C    0 134 124
13 Light Blue      240°  100%   50%  #007EB7    0 126 183
14 Light Violet    300°  100%   50%  #CD00E2  205   0 226

atomic-acid-mc

Feel free to make new custom themes.

PS. I hope you find a new job! Good luck!