gka / chroma.js

JavaScript library for all kinds of color manipulations
https://gka.github.io/chroma.js/
Other
10.14k stars 546 forks source link

allow luminance adjustments by interpolation on color spaces other than RGB #249

Closed tstaylor7 closed 3 years ago

tstaylor7 commented 3 years ago

per here and here

I tried to maintain a similar coding style, but the arguments weren't variable here, though I could see where you might prefer the following (a la here):

Color.prototype.luminance = function(lum, ...rest) {
    let mode = rest[0] || 'rgb';
tstaylor7 commented 3 years ago

Sorry, I should have made a branch before posting the pull request. I can create a new one on my new luminance-interpolation-mode branch that only contains the original commit, if you would like.