# Min and max values for Picture.ColornessMBS?

Hi,

The Colorness function is documented here: Monkeybread Xojo plugin - Picture methods

There’s no mention of the minimum and maximum values of the parameter. All I can see is it’s not a double from 0 to 1, since the parameter defaults to 10.

Please, can you tell me these values?

So the function loops over all pixels in a picture.

calculates how much they are away from gray levels.

e.g. red is 200, green is 200 and blue is 200 → gray pixel. But red is 200, green is 0 and blue is 0 → value is 200 for the difference.

And that is bigger than the threshold, so it is counted.

Result is colored pixel count divided by total pixel count.

Ah, I see. Threshold is simply the computed difference. Thank you.

If, say, red is 50, green is 100 and blue is 200, is the source value the middle one?

100-50 → 50
200-100 → 100

so this is a colored pixel as either of the differences is >threshold.

Yes, of course. I was rather asking what is the formula for the return value.