Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 color blending
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Homer_simpson




PostPosted: Thu Jan 15, 2009 12:17 pm   Post subject: color blending

Quote:
var newColor := RGB.AddColor (1.0, 1.0, 0.0)

for x : 1 .. maxx by 30
for y : 1 .. maxy by 30
Draw.FillOval (x, y, Rand.Int (10, 100), Rand.Int (10, 100), Rand.Int (1, maxcolor))
end for
end for

var x1, x2, y1, y2 := 0
var R, G, B, R2, G2, B2 : real

x1 := 1
x2 := maxx
y1 := 1
y2 := maxy
var col : array 1 .. maxx, 1 .. maxy of int

for x : x1 .. x2
for y : y1 .. y2
col (x, y) := whatdotcolor (x, y)
end for
end for



cls



for x : x1 .. x2
for y : y1 .. y2
Draw.Dot (x, y, Rand.Int (1, maxcolor))
end for
end for



for x : x1 .. x2
for y : y1 .. y2
RGB.GetColor (col (x, y), R, G, B)
RGB.GetColor (whatdotcolor (x, y), R2, G2, B2)
Draw.Dot (x, y, RGB.AddColor ((R + R2) / 2, (G + G2) / 2, (B + B2) / 2))
end for
end for
Sponsor
Sponsor
Sponsor
sponsor
twinblade27




PostPosted: Mon Nov 09, 2009 2:59 pm   Post subject: RE:color blending

nice colour blending code man this really helped me in my turing project really well. it really works on pictures if you have the picture . well thnx man i owe you alot
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: