bgrins / TinyColor

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

Monochrome is only working in in darker range. #228

Open TJ-shmt opened 3 years ago

TJ-shmt commented 3 years ago

Ive been trying to write some code to get a monocrome palette for one color.

IMO, Monochromatic should go from white to black range. However the monochroatic filter in TinyColor only goes from the input color to black. I am not sure if i made a mistake here, and did not understand the guide, or if it is really like i said.

var color1 = tinycolor("blue"); var mono =color1.monochromatic(3); document.getElementById("main").style.backgroundColor = mono[0].toHexString(); document.getElementById("dark").style.backgroundColor = mono[1].toHexString(); document.getElementById("light").style.backgroundColor = mono[2].toHexString();

1 was basically almost black while 2 was midrange between basecolor and black.