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
chroma.scale('Spectral').domain([1,0]) vs chroma.scale('Spectral').domain([1,0]).colors(12) do not match.
That is to say chroma.scale('Spectral').domain([1,0]).colors(12) === chroma.scale('Spectral').colors(12)
The text was updated successfully, but these errors were encountered:
ClaytonSmith
changed the title
BUG: chroma.scale('Spectral').domain([1,0]).colors(12), Colors does not respect the change in domain
BUG: chroma.scale('Spectral').domain([1,0]).colors(12), Colors() does not respect the change in domain
Feb 21, 2024
ClaytonSmith
changed the title
BUG: chroma.scale('Spectral').domain([1,0]).colors(12), Colors() does not respect the change in domain
BUG: scale.colors() does not respect the change in domain
Feb 21, 2024
Not really sure it's a bug, but more your expectation about it (not saying its not a logical expectation).
Colors returns n equidistant colors, and the output is right in both cases. If you change the domain to any other value, not an inversion, the output is "right". You are expecting that inverting the domain equals to inverting the scale, but that's not the current design. The scale is set according to the original color array passed, and .colors() just creates a new array using that reference. The domain has nothing to do with it. If you want to invert the scale, invert the colors output.
In fact, if you try any other scale modification (like .mode), .colors is not affected by it. Whatever method you apply to the scale does not change the scale, just its representation. They are different things. colors() is only related to the scale, not its representation.
chroma.scale('Spectral').domain([1,0])
vschroma.scale('Spectral').domain([1,0]).colors(12)
do not match.That is to say
chroma.scale('Spectral').domain([1,0]).colors(12) === chroma.scale('Spectral').colors(12)
The text was updated successfully, but these errors were encountered: