skip to Main Content

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


  1. 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:

    ['#AC725E', '#D06B64', '#F83A22', '#FA573C', '#FF7537', '#FFAD46', '#42D692', '#16A765', '#7BD148', '#B3DC6C', '#FBE983', '#FAD165', '#92E1C0', '#9FE1E7', '#9FC6E7', '#4986E7', '#9A9CFF', '#B99AFF', '#C2C2C2', '#CABDBF', '#CCA6AC', '#F691B2', '#CD74E6', '#A47AE2'];
    

    New colors:

    ['#795548', '#e67c73', '#d50000', '#f4511e', '#ef6c00', '#f09300', '#009688', '#0b8043', '#7cb342', '#c0ca33', '#e4c441', '#f6bf26', '#33b679', '#039be5', '#4285f4', '#3f51b5', '#7986cb', '#b39ddb', '#616161', '#a79b8e', '#ad1457', '#d81b60', '#8e24aa', '#9e69af'];
    

    I created a demo: https://codepen.io/chiss22/pen/qBdEqdj

    Login or Signup to reply.
  2. 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 🙂

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search