rgb

Non-platform specific questions.

rgb

Postby Troodon » Sat Feb 04, 2006 11:30 am

How can I make this code work?
terminator.r = rand(1*255);
terminator.g = rand(1*255);
terminator.b = rand(1*255);
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby Novice » Sat Feb 04, 2006 11:46 am

Code: Select all
terminator.r = round(rand(254))+1;
terminator.g =  round(rand(254))+1;
terminator.b =  round(rand(254))+1;

Use this code if you want to avoid zero.
Code: Select all
terminator.r = round(rand(255));
...

This will get you values from 0 to 255.
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest