BlitzCoder Essentials
•
Home Page
•
About BlitzCoder
•
Contributors
•
Terms of Use
•
Email Us
Main Areas
•
BlitzCoder Chat
•
Discussions
•
Articles/Tutorials
•
Code Database
•
Link Database
•
Showcase Area
•
Worklogs
•
Competitions
Special Areas
•
Undocumented
Other Blitz Sites
•
Blitz Basic Home
•
Blitz Showcase
•
BlitzPlay Library
Forum Login
Username:
Password:
•
Register Now!
BlitzCoder Code Archives Page
Main Codes Page
"Passing a true RGB value to the Color() function"
, by thechange
There are actually 2 different uses of the Color command.
Code
;------------------------------------------------------------------------------; ; Normally you can specify red, blue and green color component parameters when ; calling the Color function, like this: Local R% = 255 Local G% = 127 Local B% = 0 Color( R , G , B ) Plot( 0 , 0 ) ; An orange dot would be placed in the top left corner of the screen. ; The second syntax is this: Color( 0 , 0 , RGB ) ; When using ReadPixel, ReadPixelFast, WritePixel and WritePixelFast, a combined ; value for the red, green and blue components is used (actually there's also an ; alpha value). So you can use the ReadPixelFast command in combination with the ; Color and Oval commands without having to do any additional maths to separate ; the red, green and blue components from the acquired RGB value. For example: Color( 0 , 0 , ReadPixelFast( 0 , 0 ) ) Oval( 0 , 0 , 20 , 10 , True ) ; Have fun :D ;------------------------------------------------------------------------------;
Copyright(c) 2000-2004, BlitzCoder. All Rights Reserved.
Code software created by Krylar's Kreations