Skip to content

Commit

Permalink
The value 255 was excluded
Browse files Browse the repository at this point in the history
Return value of random doesn't include number itself, so random(255) never generates 255.
  • Loading branch information
yajoodani authored Nov 21, 2021
1 parent 11e5f55 commit d139d5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion javascript/building-blocks/events/useful-eventtarget.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}

function bgChange() {
const rndCol = 'rgb(' + random(255) + ',' + random(255) + ',' + random(255) + ')';
const rndCol = 'rgb(' + random(256) + ',' + random(256) + ',' + random(256) + ')';
return rndCol;
}

Expand Down

0 comments on commit d139d5f

Please sign in to comment.