Prev: Multiple reference locking/unlockng in formulas
Next: How to limit number of Message Boxes on Validation Error?
From: Paul W Smith on 26 Apr 2010 09:37 I want to have 20 shades of a color. 1 being the darkest, 20 being the lightest. I am going to use this to color the cell background through code based on the 1 - 20 value. If I use .color = 6684672 as the 1 value, how do I graduate this down to say ..color = 16767449 as the 20 value?
From: joel on 26 Apr 2010 11:25 I usually record a macro and then maually select the colors I want. Then use the color numbers from the recorded macro in my code. the color numbers is a hexidecimal number which is in three parts (Red=0 to 255, Green=0 to 255, Blue=0 to 255). So you could uses Red = 25 Green = 50 Blue = 10 Mycolor = (Red*256*256) + (Green*256) + Blue -- joel ------------------------------------------------------------------------ joel's Profile: http://www.thecodecage.com/forumz/member.php?u=229 View this thread: http://www.thecodecage.com/forumz/showthread.php?t=198482 http://www.thecodecage.com/forumz
From: Peter T on 26 Apr 2010 11:50 Do a quick search for functions to convert RGB to HSL, and back again HSL to RGB, you'll find lots of examples to play with. Having return HS discard the L. Make 20 incremented values between say 0.8 to 0.1 as new L values (0 will be black and 1 white, so don't bother with values near those). With the original H & S and your new Ls make your new RGBs. FWIW, with 20 shades it will be difficult to distinguish them all unless they are placed adjacent, only then are the small shade differences noticeable. Regards, Peter T "Paul W Smith" <pws(a)NOSPAM.twelve.me.uk> wrote in message news:e64OpWU5KHA.1424(a)TK2MSFTNGP04.phx.gbl... >I want to have 20 shades of a color. 1 being the darkest, 20 being the >lightest. I am going to use this to color the cell background through code >based on the 1 - 20 value. > > If I use .color = 6684672 as the 1 value, how do I graduate this down to > say .color = 16767449 as the 20 value? >
From: Paul W Smith on 26 Apr 2010 12:16 Thanks Joel. I too record macros to get color numbers. However in this instance I can use this meethod to determine to number for the darkest color, but how do I find the number of the next shade.... with the shades graduating on a scale of 1 to 20 with 1 being the darkest and 20 being the lightest? "joel" <joel.4a17yc(a)thecodecage.com> wrote in message news:joel.4a17yc(a)thecodecage.com... > > I usually record a macro and then maually select the colors I want. > Then use the color numbers from the recorded macro in my code. the > color numbers is a hexidecimal number which is in three parts (Red=0 to > 255, Green=0 to 255, Blue=0 to 255). > > > So you could uses > > Red = 25 > Green = 50 > Blue = 10 > > > Mycolor = (Red*256*256) + (Green*256) + Blue > > > -- > joel > ------------------------------------------------------------------------ > joel's Profile: http://www.thecodecage.com/forumz/member.php?u=229 > View this thread: > http://www.thecodecage.com/forumz/showthread.php?t=198482 > > http://www.thecodecage.com/forumz > >
From: joel on 26 Apr 2010 12:37 Pick 20 different shade in the macro. Don't use colorindex, instead select more colors. Convert the shades to hexidecimal to help you get the inbetween shades MyColor = 10053375 RedShade = int(MyColor/(256*256)) GreenShade = int(MyColor/256) mod 256 BlueShade = MyColor Mod 256 -- joel ------------------------------------------------------------------------ joel's Profile: http://www.thecodecage.com/forumz/member.php?u=229 View this thread: http://www.thecodecage.com/forumz/showthread.php?t=198482 http://www.thecodecage.com/forumz
|
Next
|
Last
Pages: 1 2 3 4 Prev: Multiple reference locking/unlockng in formulas Next: How to limit number of Message Boxes on Validation Error? |