Fixes setPixel function

- The setPixel function now clamps values between 0 and 1.