Color actually is really close to an int, because it is represented by the numbers -1 to -16million~, that’s also why 255 doesn’t work. What you could do is use color(255) instead of 255. This will return -16million as an int, while color(0) would give out -1.
I did notice that P5.js and processing.js were very strict about having to declare the var as a color. So even being able to just use 0x… as a color is is a plus for processing.
I think that’s due to the fact that int and color both are similar and to avoid confusing ints with color and viceversa that might have to be set explicitly, to avoid a color being used as normal int… although i can’t think of a case in which that would apply… so take what i said with a grain of salt(or a spoon of salt actually )
Color-related functions interpret the passed color argument as gray if it’s within a 0 to 255 range.
Otherwise it treats it as a full 32-bit aRGB color value.