Color Values in VBA

P

PeterM

I have an AC2003 database that has a textbox with a backcolor. I need to
dynamically change the backcolor value to a lighter shade of the textboxes
current backcolor. After playing with the colorpicker in Access, I noticed
that the Hue and Sat values remain constant, however the Lum increases when
the shade gets lighter. I know how to specify the RGB values to determine
the access color value. For example RGB(255,0,0) equals 255 for red and
RGB(255,255,0) equals 65535 for yellow. I have a subroutine that converts
any backcolor value to it's RGB equivalent. Since the users can specify the
backcolor value I need a routine to determine the lighter shade because of
the various colors the user can specify.

Is there a method or procedure to determine the lighter shade of the color?
I tried doing a search on LUM or SAT or HUE and got nowhere.

Thanks!
 
A

Al Campagna

PeterM,
Lum, Sat, and Hue are a function of the RGB values, so there's nothing
to "control" through VB for those properties.

With a Lum of 120, RGB(255,0,0) is bright red.
With a Lum of 75 the RGB(159,0,0) is a darker brick red.
By lowering the Red value in the RGB expression, you've
lowered/controlled
the Lum value.
--
hth
Al Campagna
Microsoft Access MVP 2007-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top