I received a list of all colors for my calendars and events using the Colors resource.
This is a list of strings like #ff45a7 (color codes).
The fact is that none of these colors match the real colors as they exist in my calendars. They are completely different. For example, for a color with colorId 1 (“lavender”, blue color), I have a code that represents green color, etc. Absolute dismatch. In the resulting color codes list (I check color by its code in the Photoshop) I see some colors that not exist in my calendars, and for similar colors I have completely different hex codes.
Perhaps there is some kind of coefficient that can be applied to the API color codes, or some method that correlates the colors obtained from API to match real calendars and events colors?
I did not find it anywhere in Google Calendar API.
2
Answers
Looks like Google is mapping their new material colors into their old set of colors. Based on the old list of colors from https://gist.github.com/alvinsj/2037080 I have created a list of two arrays to help anyone else map it up:
Old colors:
New colors:
I created a demo: https://codepen.io/chiss22/pen/qBdEqdj
If anyone’s quickly looking for one colour or whatever else, I took the above hex codes ("New Colors") and matched them to their Google names.
In the order of the codes above:
Cocoa #795548, Flamingo #e67c73, Tomato #d50000, Tangerine #f4511e , Pumpkin #ef6c00, Mango #f09300, Eucalyptus #009688, Basil #0b8043, Pistachio #7cb342, Avocado #c0ca33, Citron #e4c441, Banana #f6bf26, Sage #33b679, Peacock #039be5, Cobalt #4285f4, Blueberry #3f51b5, Lavender #7986cb, Wisteria #b39ddb, Graphite #616161, Birch #a79b8e, Beetroot #ad1457, Cherryblossom #d81b60, Grape #8e24aa, Amythyst #9e69af
Image of Google Calendar colour selection menu
In rows accd to this ^ image (left to right):
Row 1: Beetroot #ad1457, Tangerine #f4511e, Citron #e4c441, Basil #0b8043, Blueberry #3f51b5, Grape #8e24aa
Row 2: Cherryblossom #d81b60, Pumpkin #ef6c00, Avacado #c0ca33, Eucalyptus #009688, Lavender #7986cb, Cocoa #795548
Row 3: Tomato #d50000, Mango #f09300, Pistachio #7cb342, Peacock #039be5, Wisteria #b39ddb, Graphite #616161
Row 4: Flamingo #e67c73, Banana #f6bf26, Sage #33b679, Cobalt #4285f4, Amythyst #9e69af, Birch #a79b8e
In columns accd to that same image (top to bottom):
Column 1:
Beetroot #ad1457
Cherryblossom #d81b60
Tomato #d50000
Flamingo #e67c73
Column 2:
Tangerine #f4511e
Pumpkin #ef6c00
Mango #f09300
Banana #f6bf26
Column 3:
Citron #e4c441
Avacado #c0ca33
Pistachio #7cb342
Sage #33b679
Column 4:
Basil #0b8043
Eucalyptus #009688
Peacock #039be5
Cobalt #4285f4
Column 5:
Blueberry #3f51b5
Lavender #7986cb
Wisteria #b39ddb
Amythyst #9e69af
Column 6:
Grape #8e24aa
Cocoa #795548
Graphite #616161
Birch #a79b8e
Hope this helps save time for someone 🙂