CodingTrain / CodingTrain/Suggestion-Box
[Quantum Continuum]: Challenge - how to enable fill good function?
- Vorherrschende Sprache
- Keine Sprachdaten
- Sterne
- 570
- Forks
- 85
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
 
### 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
}
```

Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Start with the linked sketch.js examples and the live demos, then review how the p5.js fill() call is expected to handle the array returned by hups(). Clarify whether this is a bug report, a tutorial topic, or a new feature, and define the expected visual result and a reproducible test before implementation.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript
- Bereich
- frontend
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 20/100