Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » RGB Color Converter?
- gtar1
-
100+ posts
RGB Color Converter?
I need to get an all black pen color and I was wondering if it would work if I could use RGB values. Or you could just show me how to get a plain black pen color.
Thanks!

- gtar1
-
100+ posts
RGB Color Converter?
Hey! Using your help, I made a pen logo! I haven't shared it, but you can check it out on phosphorus: https://phosphorus.github.io/#140520107
- Extremguy
-
100+ posts
RGB Color Converter?
R = Red
G = Green
B = Blue
Color = (R * 65536) + (G * 255) + B
R , G and B should be from 0 to 255 inclusively.
The RGB for Black is (0,0,0) or just 0 if we do the formula up here.
https://wiki.scratch.mit.edu/wiki/Computer_Colors
G = Green
B = Blue
Color = (R * 65536) + (G * 255) + B
R , G and B should be from 0 to 255 inclusively.
The RGB for Black is (0,0,0) or just 0 if we do the formula up here.
https://wiki.scratch.mit.edu/wiki/Computer_Colors
- stickfiregames
-
1000+ posts
RGB Color Converter?
For RGB colours in general you have to do this for decimal RGB values (0-255):cool! thanks!
or this for hex codes:
Last edited by stickfiregames (Jan. 22, 2017 12:56:42)
- ad1406
-
63 posts
RGB Color Converter?
To get a black color.
Last edited by ad1406 (Jan. 22, 2017 13:08:43)
- TheLogFather
-
1000+ posts
RGB Color Converter?
Just to note that the value multiplying the G should be 256, not 255. R = Red
G = Green
B = Blue
Color = (R * 65536) + (G * 255) + B
R , G and B should be from 0 to 255 inclusively.
You also should ensure R and G are integers (otherwise it'll ‘bleed’ into the lower components when multiplied by 65536 and 256)…
[Doesn't matter about B being an integer, since it can't bleed into anything lower. It'll only take the integer part of B anyway.]
Also, you can make the pen semi-transparent by setting the alpha component:
A*16777216 + R*65536 + G*256 + B
The alpha value, A, should also be an integer from zero to 255. A value of 255 means fully opaque while a value of one means pretty much totally transparent. Note that an alpha value of zero is considered to be fully opaque, in order to make everything backward compatible with earlier versions of Scratch that did not recognise the alpha component.
Last edited by TheLogFather (Jan. 22, 2017 16:23:17)
- ThunderBolt-
-
16 posts
RGB Color Converter?
if i want to color something on pen from a rainbow pallete and move the sprit of tthe pen to a random place how do i get the color it is on without a million touching colorblocks?
- Tronche2Cake
-
100+ posts
RGB Color Converter?
You could use the pen's brightness value and set it to the minimum
- Invalid_text
-
100+ posts
RGB Color Converter?
What about costumes? How do you change the color of a costume using hex code?
- Discussion Forums
- » Help with Scripts
-
» RGB Color Converter?