Author Topic: RGB Color Codes?  (Read 1527 times)

I don't understand RGB color coding i am trying to edit rainbow mod for a friend and i don't understand the colors.


Code: [Select]
function JuiceboxPlayerLoop()
{
    if($JuiceboxPlayerCount > 63)
$JuiceboxPlayerCount = 0;

    $R=0.5+0.5*mSin($JuiceboxPlayerCount*3.14/16.0);
    $G=0.5+0.5*mSin($JuiceboxPlayerCount*3.14/16.0+21.0);
    $B=0.5+0.5*mSin($JuiceboxPlayerCount*3.14/16.0+42.0);
    $pref::Avatar::PackColor=$[b]B[/b] SPC $[b]P[/b] SPC $[b]B[/b] SPC "1";
    $pref::Avatar::AccentColor=$B SPC $P SPC $B SPC "1";
    $pref::Avatar::SecondPackColor=$B SPC $P SPC $B SPC "1";
    clientcmdupdateprefs();
    $JuiceboxPlayerCount++;
    $JuiceboxPlayer=schedule(100,0,JuiceboxPlayerLoop);
}

The letters "R" "G" and "B" are part of the color cycle.

If they are changed they have different effects on the color such as:

BGC - Cycles from Red to Green to Orange

I don't understand how they work i want it to cycle certain colors can someone help?

First off, I wouldn't suggest using rainbow player mod as it is pretty hated, but whatever, your choice.

RGB values are color values. It's saying how much red, green and blue to put into the color you're making. The "1" at the end of the $Pref::Avatar statements is saying that it's not transparent.
Basically, if you know your basic color mixings, you'll be alright. If you don't, go into Blockland, press "Player" on the main menu and click "Colorset". Play around with the sliders awhile to familiarize yourself with them.

what is in that code is actually Hex color, not RGB, but they are similar.

RGB uses a mathematical 0-255 scale using multiples of 15
Hex color uses a scale of 0.000000 to 1.000000

Hex includes a fourth value, "A", which is the opacity (trans) of the color.  RGB only has this option in RGBA format.

also incase you're wondering what A stands for (not what it does) the answer to that is "Alpha" as in an alpha channel

the more you knooooow..

RGB uses a mathematical 0-255 scale using multiples of 15
Hex color uses a scale of 0.000000 to 1.000000
Not sure where your getting multiples of 15, and 0-1 is RGB(/decimal) as well
Hex(or hexadecimal) is 16 digits, 0-9 and A-F. A hex color code would be something like 4D2E56

Not sure where your getting multiples of 15, and 0-1 is RGB(/decimal) as well
Hex(or hexadecimal) is 16 digits, 0-9 and A-F. A hex color code would be something like 4D2E56

Meh, that's what I get for not it up before I posted.

I though RGB was only the 0-255 (it is multiples of 15) scale.

Meh, that's what I get for not it up before I posted.

I though RGB was only the 0-255 (it is multiples of 15) scale.
Its also multiples of 5 if you're going with what you are.