RGBColor is another simple class module that should be helpful
to at least a few people out there. Periodically someone will
ask how to extract the red, green, and blue values from a 
color, or how to find the real color value of a system color.
RGBColor does this and also lets you Set, and Get, the color
value as a hex string (e.g. &HC0C0C0) or as an RGB string
(e.g. 0 0 255). It will also let you find the nearest solid
color which is handy sometimes.

It hasn't been tested on hi-color systems so let me know if it
does anything funky in hi-color mode.

This software, and the included source code, is FREEWARE.

You may use it as you see fit in your own projects but you may 
not re-sell the original or a derivative. If you redistribute 
it you must include this disclaimer and all original copyright
notices. 

No warranty is inferred or implied, as always seems to be the
case with software these days. Use at your own risk. Keep away
from small children. Don't exceed recommended dosage. I'm not
liable, I'm not liable, I'm not liable.

I'd love to see people improve upon this work. Please keep me 
posted if you do. If you should happen to change the behavior
in a derivative version please change the class name so as not
to cause problems with existing code.

Enjoy!

--Gregg Irwin [72450,676]

--------------------------------------------------------------

Q. How do I use it?

A. Look at the code in the sample project. That's the best
   thing I can tell you.

--------------------------------------------------------------

Q. What if I want to write the color out to an INI file or
   read values from an INI file into an instance of RGBColor?

A. The AsHexString and AsRGBString will give you two options
   of how to format the color when you write it out. 
   
   When you read the value from the INI file you need to know
   if it's a Hex string or an RGB string so you can use the
   proper method (FromHexString and FromRGBString respectively). 
   Other than that RGBColor will handle the rest.

--------------------------------------------------------------

Q. I need byte values to pass to API functions that want 
   RGBQUAD or RGBTRIPLE parameters.

A. Check out the AsRGBQuad and As RGBTriple methods. They 
   won't return an actual structure (Type variables aren't
   allowed in the public interface of a class module). Instead
   they return a Variant containing an array of bytes. 
  
--------------------------------------------------------------

Q. Where's the error handling code?

A. What do you want for free?<g> This was a fun, quickie 
   project I did quite a while ago. It isn't production code.
   It does need it, and I'll be adding it at some point, but
   don't hold your breath.<g>

--------------------------------------------------------------

Q. Why a class module?

A. In this case the methods are the biggest benefit. Storing
   the actual color value is nothing. Being able to get at
   it in many ways is very useful.

--------------------------------------------------------------

Q. What if I have suggestions, requests, or improvements?

A. Send them to me and I'll get back to you as quickly as I 
   can. Hopefully we can make it a community effort and build
   up a good library of tools that we can all draw upon.

--------------------------------------------------------------

Q. What if it has a bug in it that costs me millions of 
   dollars?

A. Re-read the disclaimer and let me know about the bug 
   please.<g>

--------------------------------------------------------------

