CodingTrain / CodingTrain/Suggestion-Box

Challenge: Color Block Highlights

Open
#1,319 1 comment 0 reactions 0 assignees View on GitHub
Challenge
Dominant language
No language data
Stars
570
Forks
85
PR merge metrics
No merged PRs in 30d

Description

I am not sure why each section is not highlighting its own color.

`void setup() {
size(680, 400);
}

void draw() {
stroke(255);
background(100);

//Line A
line(340, 0, 340, height);

//Line B
line(0, 200, width, 200);

//Logic

//White
if (mouseY > 200) {
fill(255);
rect(340, 200, 400, 400);
}

//Purple
else if (mouseY < 200) {
fill(#9D6BFF);
rect(0, 0, 340, 200);

//Green
} else if (mouseX > 400) {
fill(0, 255, 0);
rect(340, 400, 200, 400);

//Blue
} else if (mouseX < 300) {
fill(0, 0, 255);
rect(0, 200, 340, 200);
}
}`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.