Skip to content

Commit

Permalink
e5/switching colors green&gold
Browse files Browse the repository at this point in the history
  • Loading branch information
nuoxoxo committed Feb 8, 2024
1 parent 2a682dc commit 144b69a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/p5components/Rotate_oop.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ const Rotate_oop = () => {

const Offset = 42
const Usize = 42
const Bright_gold = p5.color("rgb(250,215,0,100)")
const Bright_green = p5.color("hex('#AAFF00')")
const Colors = [
Bright_gold,
Bright_green
]
const Color = Colors[Math.floor(Math.random() * Colors.length)]

class Something {
constructor(r, c, size) {
Expand Down Expand Up @@ -55,7 +62,7 @@ const Rotate_oop = () => {
p5.rectMode(p5.CENTER)
p5.angleMode(p5.DEGREES)
p5.noStroke()
const Bright_gold = p5.color("rgb(250,215,0,100)")

R = p5.height / unit_size
C = p5.width / unit_size
let r = -1
Expand All @@ -64,7 +71,7 @@ const Rotate_oop = () => {
let c = -1
things[r] = []
while (++c < C) {
p5.fill(Bright_gold)
p5.fill( Color )
things[r][c] = new Something(
unit_size / 2 + r * unit_size,
unit_size / 2 + c * unit_size,
Expand Down

0 comments on commit 144b69a

Please sign in to comment.