Hi in this exercise, you want a RGB number that is less or equal to 255. But Math.floor(Math.random()* 255) gives you at the highest the number 254 right?

That is correct.

To get a number between 1 and 255:

```
Math.floor((Math.random() * 255) + 1);
```

But RGB also includes â€ś0â€ť, so this will give a number between 0 and 255:

```
Math.floor(Math.random() * 256);
OR
Math.round(Math.random() * 255);
```

Unfortunately I donâ€™t have access to paths, so I canâ€™t see all of the criteria for the lesson.

1 Like