LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Programatically dim (lighten the color) of a cell.

Yes! This is more to what I'm getting at Peter.
I'll look into converting RGB to HSL, then adjusting the L, then converting
back to RGB. Without any knowledge beyond what you've said, this sounds
like exactly like what I'm trying to do. It also sounds easier than mixing
pattern grey shades. I'm not sure, but at least now I know where to look
and where to possible point further questions.

Thanks.
-Jeremy

Peter T wrote:
Hi Jeremy

I know I can read the RGB value of a color in VBA.


If you use customized palette colours be sure to read the RGB of the
color index and not the RGB of some format. Otherwise you may return
the default palette colour rather than the actual colour (depends on
other factors related in your overall code).

Is there a consistent way to do a calculation on those values to
visually return the same color but lighter (dimmer)?


Depending on what you mean by making lighter/darker it probably
involves converting RGB to HSL, adjusting the L value +/- then
reconverting the new HSL to RGB. Then perhaps customizing one of the
palette colours with the new RGB.

But if all you want to do is format a similar colour lighter/darker a
crude way is mixing pattern "grey" shades with pattern colour white
through grey to black. If you want to go further over 2000 unique
colours can be "simulated" using pattern shades with the default
palette of 46 unique colours (56-10 duplicates).

Regards,
Peter T

"Jeremy Gollehon" wrote in message
...
I know I can read the RGB value of a color in VBA.

Is there a consistent way to do a calculation on those values to
visually return the same color but lighter (dimmer)?

Thanks,
Jeremy



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing font color of protected cells programatically Nigel Excel Discussion (Misc queries) 6 September 13th 08 12:32 PM
can I lighten background page numbers LA Horowitz Excel Discussion (Misc queries) 2 January 18th 08 02:06 AM
can i access the cell colour programatically? eg if cell is blue Tony2Far Excel Discussion (Misc queries) 2 August 9th 06 06:50 PM
programatically color fonts and auto sorting [email protected] Excel Programming 2 December 26th 05 07:03 AM
Excel: is there a way I can lighten the fill colors in a cell? Bob Tourkow Excel Discussion (Misc queries) 1 September 15th 05 02:27 PM


All times are GMT +1. The time now is 12:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"