A very easy rainbow draw


#1

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.


#2

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.


#3

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
To
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.


#4

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


#5

Isn’t the dark purple 0?


#6

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


#7

@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


#8

I always make that mistake, too!


#9

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:


#10

Nah. It is alright.


#11

You could also do it with hsb colours!


#12

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).


#13

They didn’t


#14

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)


#15

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:


#16

FYI, the last word should be ‘well’.


#17

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


#18

Neither is mine.

And English is my native language.


#19

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


#20

thank you this helped me!!!:grinning: