Open ClaytonSmith opened 7 months ago
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.
idk, using padding
and gamma
do change the colors returned so I'm not sure why domain
is any different.
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)