ScratchData LogoScratchData
Back to mlcreater's profile

Color bug cube

MLmlcreater•Created August 28, 2023
Color bug cube
0
0
11 views
View on Scratch

Instructions

See to which RGB colors setting the pen color makes the pen color 1 bit too low in any channel—the pixel colors show which channels will be set correctly: [R][G][B] ✅✅✅ white (entirely correct) ✅✅❌ yellow ✅❌✅ magenta ✅❌❌ red ❌✅✅ aqua ❌✅❌ lime ❌❌✅ blue ❌❌❌ black The picture shows errors on inputs in a section of an RGB cube where one channel has a constant value. Click the buttons on the edges of the image to see sections in other directions. The button in the corner of the Stage hides or shows the big cross.

Description

The "set pen color to ()" block can accept an RGB color as 256²r+256g+b. It converts that to HSV to be like "set pen () to ()", then converts back to RGB for drawing. Because of floating-point arithmetic error the results may not be exactly whole numbers, then the HSV to RGB conversion always rounds down each component, often making the resulting color 1 less than the specified value (like 240→239.9999→239).

Project Details

Project ID886537729
CreatedAugust 28, 2023
Last ModifiedOctober 11, 2023
SharedAugust 29, 2023
Visibilityvisible
CommentsAllowed