Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Set color to RGB values
- Skill_Games
-
Scratcher
100+ posts
Set color to RGB values
I'm wonding if there is any way to use the set color block to properly display RGB values (without using pen)
- Troyer_Kem
-
Scratcher
1000+ posts
Set color to RGB values
There is no way to make, I think. You only can do that with pen blocks.
set pen color to (join (#caf7f2) [])
- axisjack
-
Scratcher
100+ posts
Set color to RGB values
There is no way to make, I think. You only can do that with pen blocks.set pen color to (join (#caf7f2) [])
Why do you need the join block?
- ExplainItPeter
-
Scratcher
13 posts
Set color to RGB values
I think you can, but,
In all likelihood, using pen is far easier
- You Need to use the brightness block too
- You Need to have the sprite be a specific color like, Color: 50; Brightness: 50; Saturation: 100;
- You Need to convert from HSL to RGB
In all likelihood, using pen is far easier
- codeman1044
-
Scratcher
1000+ posts
Set color to RGB values
Actually, you can use multiple methods for scratch to accept colors:
RGB (red green blue), where it's
Method 1: using 3 different colors to use the 6 digits:
hope this helps!
RGB (red green blue), where it's
((((R)*(65536)) + ((G) * (256))) + (B))RGBA (red green blue alpha), where it's
(((A)*(16777216)) + ((R) *(65536))) + (((G) * (256)) + (B))and finally, hexadecimal. You can't use a hashtag in front of the numbers (example #45a6b2) but instead leave out the hashtag.
Method 1: using 3 different colors to use the 6 digits:
Method 2: Using 6 different colors:
set [hex v] to (join (join (join (join (join (1::variables) (1::variables)) (2::variables)) (2::variables)) (3::variables)) (3::variables))
set [hex v] to (join (join (join (join (join (1::variables) (2::variables)) (3::variables)) (4::variables)) (5::variables)) (6::variables))Method 3: Using 8 different colors to manipulate alpha as well:
set [hex v] to (join (join (join (join (join (join (join (A1) (A2)) (1::variables)) (1::variables)) (2::variables)) (2::variables)) (3::variables)) (3::variables))Then use this for the code:
(join [0x] (hex))Link to wiki page: https://en.scratch-wiki.info/wiki/Computer_Colors
hope this helps!
- spocite
-
Scratcher
500+ posts
Set color to RGB values
I'm not contributing much, especially since this has already been answered. Anyways, this is a very helpful post and I use this literally any time I use pen (which is a lot more than you may think) But maybe you should close this post 

- HumanoidX
-
Scratcher
7 posts
Set color to RGB values
Excuse me, if this work in pen, does it works on color effect?
- PersRufaro
-
Scratcher
100+ posts
Set color to RGB values
Please don’t necropost (posting on an old topic). This topic is already resolved. Thank you!(join (#ff0000) [])or(join [0x] (#ff0000))

Last edited by PersRufaro (April 20, 2020 10:07:19)
- ODB5306Clickers
-
Scratcher
4 posts
Set color to RGB values
how do i convert from HSL to RGB in scratch
if <<odb5306clickers needs help?> and <you know how to help?>> then
tell how to help
else
yeet (username)
end
Last edited by ODB5306Clickers (June 13, 2020 19:15:29)
- fastTEF
-
Scratcher
60 posts
Set color to RGB values
Actually, you can use multiple methods for scratch to accept colors:What does R and G and B equal?((((R)*(65536)) + ((G) * (256))) + (B))
- Skill_Games
-
Scratcher
100+ posts
Set color to RGB values
This post is ancient, please don't necropost. (R, G, and B stand for red, green, and blue btw)Actually, you can use multiple methods for scratch to accept colors:What does R and G and B equal?((((R)*(65536)) + ((G) * (256))) + (B))
- Nezon
-
Scratcher
1000+ posts
Set color to RGB values
hey can you close your topicThis post is ancient, please don't necropost. (R, G, and B stand for red, green, and blue btw)Actually, you can use multiple methods for scratch to accept colors:What does R and G and B equal?((((R)*(65536)) + ((G) * (256))) + (B))
- codewithMateo
-
Scratcher
10 posts
Set color to RGB values
Excuse me, if this work in pen, does it works on color effect?Yes it does but you have to
(() * (2))on what @codeman1044 said.
- Discussion Forums
- » Help with Scripts
-
» Set color to RGB values














