Skip to content

"Touching color" blocks on CPU path don't apply brightness or color effects properly #578

@adroitwhiz

Description

@adroitwhiz
Contributor

Expected Behavior

"Touching color" blocks should accurately test for the colors displayed on the stage.

Actual Behavior

The brightness and color effects aren't accurately applied on the CPU path (used by the two "touching color" blocks).

On the GPU, the brightness effect is implemented by adding to or subtracting from the RGB pixel values. On the CPU, however, it is implemented by increasing or decreasing the pixels' "lightness" in the HSL color space.

On the GPU, the color effect is implemented by rotating the pixel values' "hue" in HSV color space. On the CPU, however, it is implemented in the HSL color space.

Steps to Reproduce

See this project for a demo of the brightness effect behaving improperly-- the crab should be touching the yellow color of the brightened cat but instead reports touching a pale orange.

See this project for a demo of the color effect behaving improperly-- the crab should be touching the darker brown color of the square at the top but instead reports touching a slightly lighter shade of brown,

Operating System and Browser

All

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Participants

      @BryceLTaylor@fsih@adroitwhiz

      Issue actions

        "Touching color" blocks on CPU path don't apply brightness or color effects properly · Issue #578 · scratchfoundation/scratch-render