# Found some problem with color

**URL:** <https://discourse.processing.org/t/found-some-problem-with-color/17521>\
**Category:** Beginners\
**Created:** [February 3, 2020, 11:32am UTC](https://discourse.processing.org/t/found-some-problem-with-color/17521 "2020-02-03T11:32:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniele92](https://avatars.discourse-cdn.com/v4/letter/d/ba9def/32.png) [@Daniele92](https://discourse.processing.org/u/Daniele92)\
**Post date:** [February 3, 2020, 11:32am UTC](https://discourse.processing.org/t/found-some-problem-with-color/17521/1 "2020-02-03T11:32:52Z")

</div>

```auto
color c= color(#2f4f4f);
color b= color(115,10,100);
color a= color(0,100,255);

void setup() {
   size(500,500);
   background(255);
   for(int i = 0; i<100; i++) {
     rett(int(random(width)), int(random(height)), 
     color(random(b), random(a), random(c))
   }
}

void draw(){  
}

void rett ( int posizioneX, int posizioneY, colore) { 
  for(int a=100; a>0; a=a-10) { stroke(255,0,0);
    fill(random(a,b,c));
    rectMode(CENTER);
    rect(posizioneX+50, posizioneY+30,a,a);
   }
}

```

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/3/3132b188c57a872da56c1d30db2d896945ebce28.png)

The question is: Why is this codes wrong?  
I want the effect like photo. So much colours in same rect. Thank you, i need to understand for classroom assignment

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [February 3, 2020, 1:49pm UTC](https://discourse.processing.org/t/found-some-problem-with-color/17521/2 "2020-02-03T13:49:12Z")

</div>

> [@Daniele92](#):
>
> fill(random(a,b,c));

should be fill(colore);

OR

`fill(color(random(b), random(a), random(c)));`

---

<div class="post-metadata">

**Author:** ![Daniele92](https://avatars.discourse-cdn.com/v4/letter/d/ba9def/32.png) [@Daniele92](https://discourse.processing.org/u/Daniele92)\
**Post date:** [February 3, 2020, 2:06pm UTC](https://discourse.processing.org/t/found-some-problem-with-color/17521/3 "2020-02-03T14:06:54Z")

</div>

When I write as you said: i view a lot of full Black rect. Unbelievable. I’m gettin mad For this code xD

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [February 3, 2020, 3:31pm UTC](https://discourse.processing.org/t/found-some-problem-with-color/17521/4 "2020-02-03T15:31:58Z")

</div>

fill(color(random(256), random(255), random(255)));

---

<div class="post-metadata">

**Author:** ![Daniele92](https://avatars.discourse-cdn.com/v4/letter/d/ba9def/32.png) [@Daniele92](https://discourse.processing.org/u/Daniele92)\
**Post date:** [February 3, 2020, 6:10pm UTC](https://discourse.processing.org/t/found-some-problem-with-color/17521/5 "2020-02-03T18:10:28Z")

</div>

Oh now this code works! Thank you appreciated man!

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [February 3, 2020, 6:36pm UTC](https://discourse.processing.org/t/found-some-problem-with-color/17521/6 "2020-02-03T18:36:11Z")

</div>

Post your entire code and then we can discuss it
