Discuss Scratch

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

Troyer_Kem wrote:

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,

  • 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
 ((((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:
 
set [hex v] to (join (join (join (join (join (1::variables) (1::variables)) (2::variables)) (2::variables)) (3::variables)) (3::variables))
Method 2: Using 6 different colors:
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?
kkony0121
Scratcher
100+ posts

Set color to RGB values

(join (#ff0000) [])
or
(join [0x] (#ff0000))
PersRufaro
Scratcher
100+ posts

Set color to RGB values

kkony0121 wrote:

(join (#ff0000) [])
or
(join [0x] (#ff0000))
Please don’t necropost (posting on an old topic). This topic is already resolved. Thank you!

Last edited by PersRufaro (April 20, 2020 10:07:19)

Vortex157
Scratcher
30 posts

Set color to RGB values

Solved where is the solution???
MartinsSpru1
Scratcher
1 post

Set color to RGB values

set
hex
to
join
join
join
join
join
1
1
2
2
3
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

codeman1044 wrote:

Actually, you can use multiple methods for scratch to accept colors:
 ((((R)*(65536)) + ((G) * (256))) + (B)) 
What does R and G and B equal?
Skill_Games
Scratcher
100+ posts

Set color to RGB values

fastTEF wrote:

codeman1044 wrote:

Actually, you can use multiple methods for scratch to accept colors:
 ((((R)*(65536)) + ((G) * (256))) + (B)) 
What does R and G and B equal?
This post is ancient, please don't necropost. (R, G, and B stand for red, green, and blue btw)
Nezon
Scratcher
1000+ posts

Set color to RGB values

Skill_Games wrote:

fastTEF wrote:

codeman1044 wrote:

Actually, you can use multiple methods for scratch to accept colors:
 ((((R)*(65536)) + ((G) * (256))) + (B)) 
What does R and G and B equal?
This post is ancient, please don't necropost. (R, G, and B stand for red, green, and blue btw)
hey can you close your topic
codewithMateo
Scratcher
10 posts

Set color to RGB values

HumanoidX wrote:

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.

Powered by DjangoBB