A very easy rainbow draw

I have seen many people make Rainbow draw pads and they code something for each colour. I have an more easy way to do it. Instead of coding something for each colour, You make a simple draw tool and for the colour, add this:

Click on the image to view it better.

It may look unusual, But I think each area of the screen has a colour assosiated with it. Click here to try the project. If you draw back and forth, The colours change according to the position.


That’s cool! I have a method for this in my drawing pad SuperDraw, and it uses the basic 23 colors that is in-built in Hopscotch (not custom colors), and that code is also really simple. I can post it if you want, but it just uses some “Leave a Trail” - blocks, variable block and a repeat forever block, I think.


Hi @FluffyMice. Thank you for sharing.

I think each area of the screen has a colour assosiated with it

Sort of. But your code creates the association. @William04GamerA mentioned “the basic 23 colors that is in-built in Hopscotch”. Each of those basic colors is associated with an integer (whole number) value. Like this:

So when your code has (self) X position / 50, it’s creating a range of values from

Min: 0 / 50 = 0
Max: 1024 / 50 = 20.48 (for an iPad)

The color block rounds the exact value to the closest integer, so you get colors 0 to 20 correlating to the X position.

Are you interested in using the HSB color values to give smoother colors similar to this?

If so, consider that you need only change the hue (the saturation and brightness can stay as default values (near 100). And Hue would need to range from 0 to 360. Give it a try! And I’ll be happy to explain more as needed.


I had made a drawing pad just like that. Nice topic!


Isn’t the dark purple 0?

1 Like

I knew this but I didnt know how to explain it. And I think that dark purple is 0???

@MR.GAM3R @FluffyMice Yeah, you’re both right. Dark purple is 0. Good catch! I even confirmed it was 0 before making the image, but apparently wasn’t paying attention. I’ll have to fix that


I always make that mistake, too!

1 Like

Are you interested in trying the same type idea with HSB color values?

Instead of converting the X position to a range of 0-20, it would just need to be converted to 0-360 for the Hue

Edit: Ok, no problem. For anyone else reading the topic who may be interested, just try this formula for Hue:

((self) X position / :iphone:Width ) * 360

And leave saturation and brightness near 100. This will create a range of hues (colors) from 0 to 360 corresponding to the X position. The outcome will be as shown a few post before this one. Have fun & keep exploring :blush:

1 Like

Nah. It is alright.

You could also do it with hsb colours!


Just a question, why did THT change the order of the colors in the color picker? In the old editor, the first color is purple (number 0), and then it goes up in the correct order to the color white (number 23).

1 Like

They didn’t

1 Like

Well yes, each number represents a default hopscotch colour in a way. We used that trick to make draw pads without HSB slots a (really) long time ago. (We used a value in the colour slot)

1 Like

Well, I know that the values are the still the same, but I meant that the order of the colors in the color picker were different from the old editor and I didn’t see a pattern between the order of the colors in the new update and the color’s value, like it was in the old editor, but I noticed a pattern now, but it’s just different from the pattern in the old editor. Sorry, I didn’t explain it well :slight_smile:


FYI, the last word should be ‘well’.

1 Like

It should, sorry. My grammar is not the best.

I have not seen any problems in your grammar, but mine can be wrong sometimes. English is not my native language :slight_smile: .

thank you this helped me!!!:grinning: