Version 2.
Main change here is to show how to make it easier to edit the data using a json file.
I used the colour json list found here https://gist.github.com/jjdelc/1868136#file-crayola-json
But any can do.
I modified the list to include ryb w bl percentages ( only first 4 with different % the others are all 0s )
[
{
"hex": "#EFDECD",
"name": "Almond",
"rgb": "(239, 222, 205)",
"ryb":{
"R":"50",
"Y":"30",
"B":"10",
"W":"5",
"BL":"5"
}
},
{
"hex": "#CD9575",
"name": "Antique Brass",
"rgb": "(205, 149, 117)",
"ryb":{
"R":"10",
"Y":"40",
"B":"40",
"W":"0",
"BL":"5"
}
},
In this list there are 133 colors. So I made sure there are 133 swatch rectangles.
The initSwatch() function.
Will set the colour of each swatch and add the ryb percent values to it's dataset and also add the colour's name.
The only addition to the original code is to show the colour name.
The json file can be edited in any text editor.
swatch_2-1.hypetemplate.zip (66.6 KB)