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

Change colors #13

Closed
dr-costas opened this issue Nov 13, 2020 · 2 comments
Closed

Change colors #13

dr-costas opened this issue Nov 13, 2020 · 2 comments

Comments

@dr-costas
Copy link

Hi,

How can I change the colors of the clock?

@mopp
Copy link
Owner

mopp commented Nov 15, 2020

Hi

You can override the default colors using g:sky_color_clock#color_stops

function! s:default_color_stops(timestamp) abort
let sunset_time_from_noon = s:get_sunset_time_from_noon(a:timestamp)
let sunrise = 12 - sunset_time_from_noon
let sunset = 12 + sunset_time_from_noon
return [
\ [sunrise - 2.0, "#111111"],
\ [sunrise - 1.5, "#4d548a"],
\ [sunrise - 1.0, "#c486b1"],
\ [sunrise - 0.5, "#ee88a0"],
\ [sunrise, "#ff7d75"],
\ [sunrise + 0.5, "#f4eeef"],
\ [(sunset + sunrise) / 2, "#5dc9f1"],
\ [sunset - 1.5, "#9eefe0"],
\ [sunset - 1.0, "#f1e17c"],
\ [sunset - 0.5, "#f86b10"],
\ [sunset, "#100028"],
\ [sunset + 0.5, "#111111"],
\ ]
endfunction
" Define global variables.
let g:sky_color_clock#latitude = get(g:, 'sky_color_clock#latitude', 35)
let g:sky_color_clock#color_stops = get(g:, 'sky_color_clock#color_stops', s:default_color_stops(localtime()))
let g:sky_color_clock#datetime_format = get(g:, 'sky_color_clock#datetime_format', '%d %H:%M')
let g:sky_color_clock#enable_emoji_icon = get(g:, 'sky_color_clock#enable_emoji_icon', has('mac'))
let g:sky_color_clock#temperature_color_stops = get(g:, 'sky_color_clock#temperature_color_stops', [
\ [263, '#00a1ff'],
\ [288, '#ffffff'],
\ [313, '#ffa100']
\ ])

@dr-costas
Copy link
Author

Great! Thnx.

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