|
-
May 4th, 2001, 08:37 PM
#1
Thread Starter
Lively Member
RGB Color Conversion
Quick, how do I convert VB's goofy hex color codes to (accruate) RGB? I had it written down someplace but I went and lost it...
~Zero the Inestimable
-
May 4th, 2001, 10:14 PM
#2
Good Ol' Platypus
I believe (was it kedaman ??) had a bunch of usermade functions that he compiled and put on the net... one of them was RGB2HEX.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
May 4th, 2001, 11:14 PM
#3
Frenzied Member
The quickest way to do it in VB (I'm talking performance speed, not coding speed) is probably using CopyMemory to copy each byte out, but this is the easy way:
Code:
Dim Red As Byte, Green As Byte, Blue As Byte
Blue = RGBValue And 255
Green = (RGBValue \ 256) And 255
Red = (RGBValue \ 65536) And 255
That's from memory so it might not be correct, but I'm pretty sure it is.
Last edited by HarryW; May 4th, 2001 at 11:18 PM.
Harry.
"From one thing, know ten thousand things."
-
May 5th, 2001, 06:53 AM
#4
Thread Starter
Lively Member
Thanks.
Thank you. I'm not too concerned about performance speed for this application. I have a very detailed and accurate image map to test this on (with color deviations of just one bit from object to object) so I'll be able to tell if it's accurate.
~Zero the Inestimable
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
|