Scratch for Java

Sprite::isTouchingColor()

Whether the sprite touches a colour: a painted pixel of the sprite lies over that colour, as the stage shows it now (backdrop, stage colour, pen strokes, stamps and other sprites with their effects; not texts, shaders or the UI layer). Colours match as in Scratch, with a small tolerance.

Examples

View on GitHub

Syntax

Java

.isTouchingColor(color)
.isTouchingColor(red, green, blue)

Scratch

<touching color [#ff0000]?>

Parameters

Name Data Type Description
color Color the colour to look for
red double red from 0 to 255
green double green from 0 to 255
blue double blue from 0 to 255

Return

boolean

isTouchingColor()

Create Shareable URL

Select Sections