You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Constructing a color using chroma(h, c, l, 'hcl') format is resulting in a different (correct) value from constructing with plain js object chroma({h:h, c:c, l:l})
See screenshot of using following constructors inside documentation page.
I also noticed the same bug. It may be that the constructor is not passing the mode parameter internally thus it returns default black. A work around would be passing the mode parameter as a property of the destructured color object like so:
chroma({ l:80, c:25, h:200,mode:'lch' });
Or the code could be internally modified to extract the mode from stringifying the objects enumerable properties like so (pseudocode):
// We could add a type check to see if the passed in color token is an object and if it doesn't have the mode property explicitly defined then we extract it from the object keys
let color = { l:80, c:25, h:200 }
let mode = color.keys.toString()
Constructing a color using
chroma(h, c, l, 'hcl')
format is resulting in a different (correct) value from constructing with plain js objectchroma({h:h, c:c, l:l})
See screenshot of using following constructors inside documentation page.
The text was updated successfully, but these errors were encountered: