(fill r g b) is not behaving like the processing one with negative inputs #39
Labels
difference
Mentions difference between Processing and Racket
documentation
Improvements or additions to documentation
Hi,
I translated some processing examples into sketching and I found out that (fill r g b) and fill(r, g, b) behave differently when passed negative numbers. The processing version just clamps the negative numbers to 0. The sketching version when called like this (fill 222 -1 0) crashes with:
My translation of the draw function vs the original processing map example.
vs.
I had to use the
max
function to clamp the value to a non-negative one. I don't know if this is a bug or good behaviour, because imo negative values for colors should actually be an error. Clamping them to 0 is maybe a problem because it could conceal other errors.I just wanted to document this difference in behaviour.
Edit: I confirmed the clamping behaviour from processing with the online tool openprocessing.
The text was updated successfully, but these errors were encountered: