PC Review


Reply
Thread Tools Rate Thread

How I can get color (RGB value) from .ThemeColor + .TintAndShade?

 
 
visual73
Guest
Posts: n/a
 
      4th Jan 2008
Hello,
I want to create a form with button. The button must be coloured in one from
color theme Excel_2007.
I can get base color theme (10 color: XlThemeColor):

Dim Color (1 To 10) As Integer
Dim Scheme As ThemeColorScheme
Set Scheme = ActiveWorkbook.Theme.ThemeColorScheme
For Color = 1 To 10
X(Color) = Scheme(Color).RGB
Next
Set Scheme= Nothing
'and
MyForm.MyButton.BackColor=X(3) '(for example)

X -array that have 10 color active theme.

But I need to define more colors in palette (50 derivative of base colors).
If I deal with cell that I can use:

Range("A1").Select
With Selection.Interior
.ThemeColor=xlThemeColorAccent1 '(for example)
.TintAndShade = 0.8 '(take on a value from 1 to -1). We to define
any from derivative of base colors
End With

But Button have not ".TintAndShade" property! May be if I know X and
TintAndShade value, can I to calculate result color?

P.S. I can be coloured cells in 60 color. Then I can to recognize RGB for
each cell and give it to button. But it not correctly way.


 
Reply With Quote
 
 
 
 
Jon Peltier
Guest
Posts: n/a
 
      4th Jan 2008
Tony Jollans has written an article about this here:
http://www.wordarticles.com/Articles/Colours/2007.htm

Unfortunately this article stops just shy of paydirt (the article is still
being edited). I read another pair of articles Tony wrote which actually
bring this to conclusion, but I can't find them. The links I have are here:
http://proofficedev.com/blog/2007/08...d-2007-part-1/
http://proofficedev.com/blog/2007/10...d-2007-part-2/

but when I follow them, all I get are php errors. I notified the webmaster,
so hopefully these will be up again soon.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"visual73" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello,
> I want to create a form with button. The button must be coloured in one
> from color theme Excel_2007.
> I can get base color theme (10 color: XlThemeColor):
>
> Dim Color (1 To 10) As Integer
> Dim Scheme As ThemeColorScheme
> Set Scheme = ActiveWorkbook.Theme.ThemeColorScheme
> For Color = 1 To 10
> X(Color) = Scheme(Color).RGB
> Next
> Set Scheme= Nothing
> 'and
> MyForm.MyButton.BackColor=X(3) '(for example)
>
> X -array that have 10 color active theme.
>
> But I need to define more colors in palette (50 derivative of base
> colors).
> If I deal with cell that I can use:
>
> Range("A1").Select
> With Selection.Interior
> .ThemeColor=xlThemeColorAccent1 '(for example)
> .TintAndShade = 0.8 '(take on a value from 1 to -1). We to define
> any from derivative of base colors
> End With
>
> But Button have not ".TintAndShade" property! May be if I know X and
> TintAndShade value, can I to calculate result color?
>
> P.S. I can be coloured cells in 60 color. Then I can to recognize RGB for
> each cell and give it to button. But it not correctly way.
>



 
Reply With Quote
 
visual73
Guest
Posts: n/a
 
      4th Jan 2008
Thanks a lot!

"Jon Peltier" <(E-Mail Removed)> сообщил/сообщила в новостях
следующее: news:(E-Mail Removed)...
> Tony Jollans has written an article about this here:
> http://www.wordarticles.com/Articles/Colours/2007.htm
>
> Unfortunately this article stops just shy of paydirt (the article is still
> being edited). I read another pair of articles Tony wrote which actually
> bring this to conclusion, but I can't find them. The links I have are
> here:
> http://proofficedev.com/blog/2007/08...d-2007-part-1/
> http://proofficedev.com/blog/2007/10...d-2007-part-2/
>
> but when I follow them, all I get are php errors. I notified the
> webmaster, so hopefully these will be up again soon.
>
> - Jon
> -------
> Jon Peltier, Microsoft Excel MVP
> Tutorials and Custom Solutions
> Peltier Technical Services, Inc. - http://PeltierTech.com
> _______
>
>
> "visual73" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Hello,
>> I want to create a form with button. The button must be coloured in one
>> from color theme Excel_2007.
>> I can get base color theme (10 color: XlThemeColor):
>>
>> Dim Color (1 To 10) As Integer
>> Dim Scheme As ThemeColorScheme
>> Set Scheme = ActiveWorkbook.Theme.ThemeColorScheme
>> For Color = 1 To 10
>> X(Color) = Scheme(Color).RGB
>> Next
>> Set Scheme= Nothing
>> 'and
>> MyForm.MyButton.BackColor=X(3) '(for example)
>>
>> X -array that have 10 color active theme.
>>
>> But I need to define more colors in palette (50 derivative of base
>> colors).
>> If I deal with cell that I can use:
>>
>> Range("A1").Select
>> With Selection.Interior
>> .ThemeColor=xlThemeColorAccent1 '(for example)
>> .TintAndShade = 0.8 '(take on a value from 1 to -1). We to define
>> any from derivative of base colors
>> End With
>>
>> But Button have not ".TintAndShade" property! May be if I know X and
>> TintAndShade value, can I to calculate result color?
>>
>> P.S. I can be coloured cells in 60 color. Then I can to recognize RGB for
>> each cell and give it to button. But it not correctly way.
>>

>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with .TintAndShade Jair Batista Microsoft Excel Programming 6 15th Sep 2009 02:33 PM
.TintAndShade under Excel2003 Tamas Konczer Microsoft Excel Programming 2 2nd Feb 2009 12:29 PM
Setting ThemeFont and ThemeColor Jan KuХera Microsoft Excel Programming 3 23rd Jan 2009 03:32 PM
themecolor, colorindex, color picker =?Utf-8?B?U2luZGk=?= Microsoft Excel Programming 0 22nd Oct 2007 07:55 PM
Excel 2007, ThemeColor Light and Dark reversed =?Utf-8?B?Q2hyaXMgSm9obg==?= Microsoft Excel Programming 7 7th Sep 2007 03:58 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:24 PM.