CodingTrain / CodingTrain/Suggestion-Box
[Quantum Continuum]: Challenge - how to enable fill good function?
- Lenguaje dominante
- Sin datos de lenguaje
- Estrellas
- 570
- Forks
- 85
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
 
### 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
}
```

Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Comienza con los ejemplos vinculados de sketch.js y las demostraciones en vivo; después, revisa cómo se espera que la llamada fill() de p5.js gestione el array devuelto por hups(). Aclara si se trata de un informe de error, un tema para un tutorial o una nueva funcionalidad, y define el resultado visual esperado y una prueba reproducible antes de la implementación.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- javascript
- Área
- frontend
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 20/100