
FB II Compiler
PG PRO
Debugging
Memory
System
Mathematics
Resources
Disk I/O
Windows
Controls
Menus
Mouse
Keyboard
Text
Fonts
Drawing
Sound
Clipboard
Printing
Communication
ASM
|
MATHEMATICS
Convert values from 256 to 65536
Here's the general formula for turning a 256 color into 65536 color value:
dim colorrec.6
colorrec.red = 255 * 256 + 255
colorrec.green = 0 * 256 + 0
colorrec.blue = 128 * 256 + 128
window #1,,(0,0)-(640,480)
call rgbforcolor(#@colorrec)
box fill 0,0 to 320,200
do:until fn button
it may not be as cut and dry as just dividing by 256
also...
Yeah, you're not using my HTML color fn :-), freely available in my Progress Bar code, at the FBII.rsrc: http://inspired.netstreet.net/FBIIrsrc/
it does web values --> color records. Simply reverse the process to get hex back. (Maybe it's not too simple to reverse, though
There's also a nice color mixer in there too, that uses two html-type colors to calculate the average.
|