Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
16 million colors, how?
Author Message
Nitro

Posted: Thu Jun 26, 2003 1:58 pm   Post subject: 16 million colors, how?

I know its possible to assign new colors using RGB values, but is it possible to turn Turing from 256 to 16 million colors?

Homer_simpson

Posted: Thu Jun 26, 2003 2:06 pm   Post subject: (No subject)

yeah... well... u know when u use 16 million colors u dont really enter a number for the color that your using for example u dont say color(26626316)
you use RGB mode so you say color(15,100,1) so u get a color... so ya u can have a lotta colors in turing if you create the color that you want right when u wanna use it...
Nitro

Posted: Thu Jun 26, 2003 3:15 pm   Post subject: hmmmm

it seems to cut me off at a max of 1024 colors...odd. why only 2^10?

Posted: Thu Jun 26, 2003 3:38 pm   Post subject: (No subject)

something along the lines of this would probably do it...

 code: var pallete : flexible array 0 .. 0 of int var count : int := 0 for r : 0 .. 255     for g : 0 .. 255         for b : 0 .. 255             new pallete, count             pallete (count) := RGB.AddColour (r / 255, g / 255, b / 255)             count += 1         end for     end for end for

unfortunately though, I don't think Turing can handle arrays of that size so maybe just do like ever second thing (just add by 2 to each of the for statements... ie for r : 0 .. 255 by 2)
Homer_simpson

Posted: Thu Jun 26, 2003 3:41 pm   Post subject: (No subject)

hells no you can't declare all those colors and put the in an array... so just create the colors u need for example if you need light red just create a color with thse numbers(128,0,0)...

Posted: Thu Jun 26, 2003 3:42 pm   Post subject: (No subject)

yeah lol... not really practical to just store all those colours like that but if you ever did want to... that would work ;D
Homer_simpson

Posted: Thu Jun 26, 2003 3:53 pm   Post subject: (No subject)

here's an example :
 code: const size := 1 var clr : int for j : 1 .. 400     for i : 1 .. 600         clr := RGB.AddColor (i / 600, j / 400, j / 100)         drawfillbox ((i * size), (j * size), (i * size) + size, (j * size) + size, clr)     end for end for

wheee look at all those pretty colors...
Catalyst

Posted: Thu Jun 26, 2003 4:14 pm   Post subject: (No subject)

mmm colors

 code: View.Set ("graphics:400;400,nobuttonbar,position:300;300") function putRGB (r, g, b : real) : int         RGB.SetColor (255, r, g, b)         result 255 end putRGB function Distance (x1, y1, x2, y2 : real) : real         result ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5 end Distance const mx := maxx div 2 const my := maxy div 2 var x, y : array 1 .. 3 of int x (1) := mx-100 y (1) := my-100 x (2) := mx+100 y (2) := my-100 x (3) := mx y (3) := my+141 const dist1 := Distance (x (1), y (1), maxx div 2, maxy div 2) const dist2 := Distance (x (2), y (2), maxx div 2, maxy div 2) const dist3 := Distance (x (3), y (3), maxx div 2, maxy div 2) for i : 1 .. maxx     for k : 1 .. maxy         drawdot (i, k, putRGB ((Distance (i, k, x (2), y (2)) / dist2), (Distance (i, k, x (1), y (1)) / dist1), (Distance (i, k, x (3), y (3)) / dist3)))     end for end for

Nitro

Posted: Thu Jun 26, 2003 9:40 pm   Post subject: My purpose?

I wanted to find a way to create a transition between with 24bit bitmap images, one fading out while the other was fading in.
Asok

Posted: Fri Jun 27, 2003 1:42 am   Post subject: (No subject)

that can be done with picMerge and masks I think. (use grey scale masks to fade in/out)
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 1  [ 10 Posts ]
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: