bgrins / TinyColor

Fast, small color manipulation and conversion for JavaScript
https://bgrins.github.io/TinyColor/
MIT License
5.05k stars 437 forks source link

Analogous returning original colors #90

Open spdaly opened 9 years ago

spdaly commented 9 years ago

I'm attempting to use TinyColor to create a set of custom tab colors for a page. The following code runs, but the resulting objects are the same color (#5c5c5c).

var tabs = $('polygon');
var color = tinycolor('#5c5c5c');
var colors = color.analogous(results = 6, slices = 30)

tabs.each(function(index){
    console.log(colors[index].toHexString());
    $(this).attr('fill', colors[index].toHexString());
})
spdaly commented 9 years ago

My color theory is obviously lacking... I tried the 5c5c5c on the demo site and got the same results. I guess my initial color just doesn't have an analogous set.