itchyny / calendar.vim

A calendar application for Vim
MIT License
1.95k stars 71 forks source link

Google Calendar events not colored correctly. #216

Closed fhvirus closed 1 year ago

fhvirus commented 1 year ago

When an event's color is not set to the same color as the calendar's default, the event is colored black.

I set the calendar's color to birch on Google Calendar's website, and all the events having syntax ID other than CalendarfrobSelect will be rendered with black foreground color. However, events with calendar's default color works fine.

I'm using vim 8.2 under konsole. I have the following options set in my .vimrc:

set t_Co=256
set termguicolors
syntax on

I'm using nord theme, which the background option is dark.

Please let me know if any further information is needed. Also, may I know the what does the characters between "Calendar" and "Select" mean? They seems random. Thanks!

itchyny commented 1 year ago

Some screenshots would be helpful to see what's happening.

fhvirus commented 1 year ago

Screenshot_20230207_225610 The two on the left column has the correct color (birch) while the one on the right column should be green. Also, my terminal has a transparent background, so the screenshot is transparent too.

itchyny commented 1 year ago

Let me know the result of

:hi CalendarfrobSelect
:hi Calendarfrob
fhvirus commented 1 year ago
:hi CalendarfrobSelect
CalendarfrobSelect xxx guifg=#cabdbf guibg=#505661
:hi Calendarfrob
Calendarfrob   xxx ctermfg=181 guifg=#cabdbf

Additionally, for those black events (there are more IDs for them, just listing two here):

:hi Calendar58kgSelect
Calendar58kgSelect xxx guifg=#1d1d1d guibg=#505661
:hi Calendar7nqmSelect
Calendar7nqmSelect xxx guifg=#1d1d1d guibg=#505661
itchyny commented 1 year ago

What are the original colors in Google Calendar? You can list the colors by jq '.items[] | { summary, colorId, foregroundColor, backgroundColor }' ~/.cache/calendar.vim/google/calendarList.

fhvirus commented 1 year ago
{
  "summary": "日曆",
  "colorId": "20",
  "foregroundColor": "#000000",
  "backgroundColor": "#cabdbf"
}

It's not the same color as displayed on the website (#a79b8e by inspecting elements), but they look similar.

itchyny commented 1 year ago

That "日曆" calendar is properly displayed on the left column in your screenshot, right? I'd like to know the original colors of calendars not displayed properly in the plugin.

fhvirus commented 1 year ago

The event on the right column is also in the calendar "日曆", but I assigned a different color for the event (for color-coding my events) from Google Calendar website using the "Select event color" button in the event's edit screen. The specific event has color "Sage", but all the color I manually choose aren't colored properly.

itchyny commented 1 year ago

I think I fixed the issue and thanks for patient debugging.