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

How to adjust background? #59

Closed
vbauerster opened this issue Jul 26, 2017 · 5 comments
Closed

How to adjust background? #59

vbauerster opened this issue Jul 26, 2017 · 5 comments

Comments

@vbauerster
Copy link

First of all thanks for this colorscheme. I mostly use the one with light background, but sometimes wish to adjust its background brightness. For example make bg a little darker or brighter depending on external illumination. How do I accomplish this? It is not clear from the readme page, should I use public one#highlight function? If yes, then which group?

@rakr
Copy link
Owner

rakr commented Aug 9, 2017

Hi, sorry for the delay (off for a month), yes you can use the one#highlight function on the Normal group.
Give it a try and close the issue if that works.

@vbauerster
Copy link
Author

Yes, it works. Thank you!

@super-cooper
Copy link

@vbauerster what command specifically did you use? I tried one#highlight('Normal', '', '29353B', 'none') and it was read as an invalid command. To be honest, it would be easier for me if I could just make it so that a custom background color was not defined, as I'd much prefer that vim use the same color as my terminal

@laggardkernel
Copy link

laggardkernel commented May 16, 2019

@super-cooper If you want change the color with the one#highlight API, you need to run the commands after VimEnter event. Otherwise, the one#highlight is not parsed as a function yet.

augroup vim-one-customization
  autocmd!
  one#highlight('Normal', '', '29353B', 'none')
augroup END

You can also have a try with my fork of vim-one, which is capable of customize the color palette like this,

let g:one_dark_syntax_bg='#29353B'

I haven't opened a pr of this feature yet, because I'm waiting the decision from rakr for my current pr.

I don't see a way for a color scheme using the same color of your terminal. Besides, for terminal, you mainly defines 16 ANSI colors and everything is done. While in vim, not only you need to define a color palette, but need to adjust the foreground and background colors for every part of the vim, all kinds of syntax highlights, diff, 3rd party plugins, etc. Color schemes for them are very different.

@super-cooper
Copy link

super-cooper commented May 16, 2019

@laggardkernel hey, thanks for the quick reply! I'm gonna give your fork a shot :)

EDIT:
Having trouble getting it to work. No errors, but it's not changing anything. My colors are defined as such:

syntax on
let g:one_dark_syntax_bg='#29353B'
let g:one_allow_italics = 1
set background=dark
colo one
if (has("termguicolors"))
  set termguicolors
endif

Is something out of order or something? I also tried with the let g:one_dark_syntax_bg='#29353B' at the end and it also didn't work.

EDIT: Nevermind, figured it out. Using call one#highlight('Normal', '', '29353B', 'none') at the end worked fine.

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

4 participants