The function used here is borrowed from
this W3C article
where the formula for an RGB color is:
brightness = sqrt( .299 R
2
+ .587 G
2
+ .114 B
2
)
I have leveled it to a scale of 0-100 and set the reversal threshold to 60 for the
Color Brewer
pallettes below.
The difference between the two colors is calculated by taking the difference of each respective channel weighted by a coefficient.
.299(maximum(Red) - minimum (Red)) + .587(maximum(Green) - minimum (Green)) + .113(maximum(Blue) - minimum (Blue))
This is also leveled to a scale of 0-100.
| Pallette | Count | Colors |