How to get Color Sampler in UXP?

I’m not sure if you were testing with masks involved but I have seen those *Float values pop up as well, seemingly randomly. Sometimes they even go negative!

I was expecting RGB values in the range [0-255] but would get very small float values instead.

For me, it seemed to happen when reading color samples when the mask channel was selected in the layer list vs when the “RGB” channel was selected.

image

So, to work around the issue, I make sure the RGB channel is selected (via BatchPlay) before reading the samples.

1 Like

I think I am onto something, 32bit colors are not in fact range [0-1] but something like [0,1048576] instead.
If color can fit [0-1] then in the descriptor it will be like [0-255] otherwise it will be in “float format”.

And this brings a whole list of questions… like 32bit solid color support, its methods… how to work with it, and others…