Discuss Scratch
- Discussion Forums
- » Bugs and Glitches
- » Pen Colors repeat each 101 numbers rather than each 100 numbers in Scratch 3.0
- Scratch-Minion
-
1000+ posts
Pen Colors repeat each 101 numbers rather than each 100 numbers in Scratch 3.0
My browser / operating system: Windows NT 10.0, Chrome 76.0.3809.132, No Flash version detected
Pen Colors repeat each 101 numbers rather than each 100 numbers in Scratch 3.0
ie. color 0 = color 101 = color 202 = color 303 … rather than color 0 = color 100 = color 200 = color 300 …
Example Scratch 3.0 project that displays lines of color 0, 100, 200, 300 … https://scratch.mit.edu/projects/327014325/

Pen Colors repeat each 101 numbers rather than each 100 numbers in Scratch 3.0
ie. color 0 = color 101 = color 202 = color 303 … rather than color 0 = color 100 = color 200 = color 300 …
Example Scratch 3.0 project that displays lines of color 0, 100, 200, 300 … https://scratch.mit.edu/projects/327014325/

- laughingKittens
-
7 posts
Pen Colors repeat each 101 numbers rather than each 100 numbers in Scratch 3.0
hey can someone tell me the bug in this project i watched the project and it looked fine. 

- Flowermanvista
-
1000+ posts
Pen Colors repeat each 101 numbers rather than each 100 numbers in Scratch 3.0
The problem is explained in the OP - the pen color should cycle every 100 numbers, instead of every 101 numbers as it does in Scratch 3.0. If this project were written out in Scratch 2.0, the project would produce a solid color on the screen.
- heldlaw
-
100+ posts
Pen Colors repeat each 101 numbers rather than each 100 numbers in Scratch 3.0
By pure coincidence I noticed the same bug today. Pen Colors repeat each 101 numbers rather than each 100 numbers in Scratch 3.0
So I looked up the relevant wiki article:
https://en.scratch-wiki.info/wiki/Pen_Color_(value)
It claims:
There are 100 possible hues, with values from 0 to 99.That may have been the intention, but as your project proves, it is not correct. (It may have been correct in Scratch 2.0.)
But hurray for the wiki article: it directs us straight to the bug!
https://github.com/LLK/scratch-vm/blob/develop/src/extensions/scratch3_pen/index.js#L200
return MathUtil.wrapClamp(value, 0, 100);
return MathUtil.wrapClamp(value, 0, 99);
https://github.com/LLK/scratch-vm/blob/develop/src/util/math-util.js#L32
Last edited by heldlaw (Sept. 8, 2019 19:27:40)
- heldlaw
-
100+ posts
Pen Colors repeat each 101 numbers rather than each 100 numbers in Scratch 3.0
I took the liberty of opening an issue (referring to this thread) and creating a pull request. But hurray for the wiki article: it directs us straight to the bug!
https://github.com/LLK/scratch-vm/issues/2273
https://github.com/LLK/scratch-vm/pull/2274
- Scratch-Minion
-
1000+ posts
Pen Colors repeat each 101 numbers rather than each 100 numbers in Scratch 3.0
I took the liberty of opening an issue (referring to this thread) and creating a pull request. But hurray for the wiki article: it directs us straight to the bug!
https://github.com/LLK/scratch-vm/issues/2273
https://github.com/LLK/scratch-vm/pull/2274
Thank-you heldlaw!
(I don't know much about github and have never programmed in javascript or anything similar).
- laughingKittens
-
7 posts
Pen Colors repeat each 101 numbers rather than each 100 numbers in Scratch 3.0
oh now i get it i dont have scratch 3.0 and i dont use pen but i think i have an answer to that, what block did you use if you used the normal one you
could try looking at the code for the block if you dont see a bug in that then ethier scratch has a bug or you havent typed the right amount.
could try looking at the code for the block if you dont see a bug in that then ethier scratch has a bug or you havent typed the right amount.
- iamdominic
-
36 posts
Pen Colors repeat each 101 numbers rather than each 100 numbers in Scratch 3.0

change pen color by (100)
LOLOLOL
Scratch team fix this bug
- laughingKittens
-
7 posts
Pen Colors repeat each 101 numbers rather than each 100 numbers in Scratch 3.0
change pen color by 100)
- Discussion Forums
- » Bugs and Glitches
-
» Pen Colors repeat each 101 numbers rather than each 100 numbers in Scratch 3.0