Open svgeesus opened 2 years ago
@LeaVerou
Maybe the max granularity shouldn't be 1 but .1? Take a look here and tell me how you think we should fix this generically. We can't just special case XYZ.
'''js let {name, range, refRange} = meta; name = name || id; range = range || refRange || [0, 100]; let [min, max] = range; let step = (max - min) / 100; if (step > 1) { step = 1; } '''
Since xyzd65
and xyzd50
don't declare a range, they end up with [0, 100] and (100-0)/100 should be 1 but is, I suspect, something like 1.00000000000001 and thus greater than 1. An epsilon in there would catch this and make it more robust. Although why forcing there to be only 100 steps is beneficial could also be examined.
Giving the relative XYZs a reference range of [0, 1] would also work.
(confirming this UI bug still exists)
Is this issue still present on https://apps.colorjs.io/picker/ ? If so, please transfer to the apps repo.
Confirming that the issue still exists, because [0..1] and [0..100] are being confused
What should the range be for each XYZ space?
As I said earlier:
Giving the relative XYZs a reference range of [0, 1] would also work.
The XYZ-d65 color picker has 0..100 scale but gives black for [0,0,0] and an oog color close to white for [1,1,1]; it is not possible to pick any other colors due to the slider granularity.