CodingTrain / CodingTrain/Suggestion-Box
[Quantum Continuum]: Challenge - how to enable fill good function?
- Dominant language
- No language data
- Stars
- 570
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
Description
 
### Good morning, Dear @shiffman! Good morning, Dear P5JS-citizens!
Let me ask some different alternatives regarding `"How to enable fill good function?"`
Here's my trial to solve it:
- [Live example of "fill good" function - https://gvitalie.github.io/demolution/hello/](https://gvitalie.github.io/demolution/hello/)
- [Code on GitHub - https://github.com/gvitalie/demolution/tree/gh-pages](https://github.com/gvitalie/demolution/tree/gh-pages)
> see line of code with `fill(good);`
```javascript
# sketch.js
function setup() {
createCanvas(windowWidth, windowHeight);
// frameRate(3);
rectMode(CENTER);
// noLoop();
}
function draw() {
background(127);
let step = 30;
for (let i = 0; i <= width; i += step){
for (let j = 0; j <= height; j += step){
// Enable fill(good) function.
let good = hups();
fill(good);
(round(random(0,1))) ? ellipse(i, j, step)
: rect(i, j, step, step);
}
}
}
// Fill good environment.
function hups(){
let c = [random(0, 255), random(0, 255), random(0, 255)];
return c
}
```
## The rezult:
_NOTE: Clicking on image below will open a Google Photos Shared Album_
[](https://photos.app.goo.gl/k99UV77J3uyXZvCX2)
# Fill good - Picasso stylus
[Live demo example @ https://gvitalie.github.io/demolution/fillgood/](https://gvitalie.github.io/demolution/fillgood/)
```javascript
# sketch.js
function setup() {
createCanvas(windowWidth, windowHeight);
frameRate(5);
rectMode(CENTER);
// noLoop();
}
function draw() {
background(127);
let step = 30;
for (let i = 0; i <= width; i += step){
for (let j = 0; j <= height; j += step){
let good = hups();
stroke(good);
strokeWeight(random(10, 30));
(round(random(0, 1))) ? line(i, j, i + step, j + step)
: line(i, j + step, i + step, j);
}
}
}
function hups(){
let c = [random(0, 255), random(0, 255), random(0, 255)];
return c
}
```

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.