-
July 18th, 2002, 09:14 AM
#1
Does anyone have a class or an algorithm that will generate a new color on every call
Please Help!
Does anyone have a class or an algorithm that would generate a new color (RGB) on every call.
Thanks in advance!
-
July 18th, 2002, 09:44 AM
#2
You can just use a loop to create different colors:
Something like:
PHP Code:
int color = 0;
for( int i=0;i<200;i++)
{
color+=79;
COLORREFCOLOR=RGB(color+(color/10),color+10,color-10);
}
I Hope this will help you !
cheers, Sonu
-
July 18th, 2002, 10:23 AM
#3
I have not tried this but it should be fairly close.
PHP Code:
int array[3];
int i = 0;
srand( (unsigned)time( NULL ) );
int i_count = 0;
while( i_count < 3 )
{
i = rand();
if(i < 255 && i > 0)
{
array[i_count] = i;
i_count++;
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|