40 lines, 6 of them comments ยท 2,265 tokens, written in 21 seconds for $0.023


 1  function setup() {
 2    createCanvas(600, 600);
 3    background(10, 10, 30); // A very dark blue, almost black
 4    noLoop();
 5  }
 6  
 7  function draw() {
 8    translate(width / 2, height / 2);
 9    let noiseScale = 0.8;
10    let numLines = 4000;
11    
12    // Draw the outer, wispy part of the seed head
13    stroke(255, 255, 240, 100); // Pale yellow with transparency
14    strokeWeight(0.5);
15  
16    for (let i = 0; i < numLines; i++) {
17      let angle = random(TWO_PI);
18      
19      // Perlin noise determines the radius, creating an organic shape
20      let noiseVal = noise(cos(angle) * noiseScale + 10, sin(angle) * noiseScale + 20);
21      let r = map(noiseVal, 0, 1, 100, 280);
22      
23      let x = cos(angle) * r;
24      let y = sin(angle) * r;
25      
26      line(0, 0, x, y);
27    }
28  
29    // Draw the denser, brighter core
30    stroke(255, 255, 250, 150);
31    strokeWeight(1);
32    for (let i = 0; i < 1500; i++) {
33      let angle = random(TWO_PI);
34      // Use pow() to cluster points more towards the center
35      let r = pow(random(1), 2) * 120; 
36      let x = cos(angle) * r;
37      let y = sin(angle) * r;
38      line(0, 0, x, y);
39    }
40  }