Officeテーマの色空間を探索するではオブジェクトテーマカラーについて探索した.今回は配色の方を探索する.
ユーザーインターフェース
配色のパターン
「ページレイアウト」タブの「テーマ」の「配色」を押下すると下図のように配色のパターンが出現する.
![Officeのテーマの配色](https://i0.wp.com/www.muscle-hypertrophy.com/wp-content/uploads/2020/04/000.png?resize=257%2C652&ssl=1)
配色の日本語名と英語名
配色の日本語名とファイル名の対応は以下の通りである.上記ユーザーインターフェースを一つ一つ選択する操作をマクロ記録して得た結果をテーブルに書き出し,ファイル名を抽出したものである.
配色(日本語名) | 配色(英語名) |
---|---|
Office | |
Office 2007-2010 | Office 2007 – 2010 |
グレースケール | Grayscale |
暖かみのある青 | Blue Warm |
青 | Blue |
青 II | Blue II |
青緑 | Blue Green |
緑 | Green |
黄緑 | Green Yellow |
黃 | Yellow |
黄色がかったオレンジ | Yellow Orange |
オレンジ | Orange |
オレンジがかった赤 | Orange Red |
赤みがかったオレンジ | Red Orange |
赤 | Red |
赤紫 | Red Violet |
紫 | Violet |
紫 II | Violet II |
デザート | Median |
ペーパー | Paper |
マーキー | Marquee |
スリップストリーム | Slipstream |
シック | Aspect |
配色はオブジェクトテーマカラーとは無関係
最初,オブジェクトテーマごとに配色のパターンが存在するのかと思っていた.しかし,どうも違うようだ.テーマを指定してから配色を確認しても,パターンに変化がない.オブジェクトテーマとは別に配色は存在するらしい.
配色パターンのキャプチャ画像
配色パターンにもテーマの色が 12 種類用意されており,これは ThemeColor オブジェクトの ThemeColorSchemeIndex プロパティ経由で取得される MsoThemeColorSchemeIndex 列挙体に該当する.
![Office](https://i0.wp.com/www.muscle-hypertrophy.com/wp-content/uploads/2020/04/001.png?resize=493%2C507&ssl=1)
![Office 2007 - 2010](https://i0.wp.com/www.muscle-hypertrophy.com/wp-content/uploads/2020/04/002.png?resize=493%2C507&ssl=1)
![グレースケール](https://i0.wp.com/www.muscle-hypertrophy.com/wp-content/uploads/2020/04/003.png?resize=493%2C507&ssl=1)
![暖かみのある青](https://i0.wp.com/www.muscle-hypertrophy.com/wp-content/uploads/2020/04/004.png?resize=493%2C507&ssl=1)
![青](https://i0.wp.com/www.muscle-hypertrophy.com/wp-content/uploads/2020/04/005.png?resize=493%2C507&ssl=1)
![青 II](https://i0.wp.com/www.muscle-hypertrophy.com/wp-content/uploads/2020/04/006.png?resize=493%2C507&ssl=1)
![青緑](https://i0.wp.com/www.muscle-hypertrophy.com/wp-content/uploads/2020/04/007.png?resize=493%2C507&ssl=1)
![緑](https://i0.wp.com/www.muscle-hypertrophy.com/wp-content/uploads/2020/04/008.png?resize=493%2C507&ssl=1)
![黄緑](https://i0.wp.com/www.muscle-hypertrophy.com/wp-content/uploads/2020/04/009.png?resize=493%2C507&ssl=1)
![黃](https://i0.wp.com/www.muscle-hypertrophy.com/wp-content/uploads/2020/04/010.png?resize=493%2C507&ssl=1)
![黄色がかったオレンジ](https://i0.wp.com/www.muscle-hypertrophy.com/wp-content/uploads/2020/04/011.png?resize=493%2C507&ssl=1)
![オレンジ](https://i0.wp.com/www.muscle-hypertrophy.com/wp-content/uploads/2020/04/012.png?resize=493%2C507&ssl=1)
![オレンジがかった赤](https://i0.wp.com/www.muscle-hypertrophy.com/wp-content/uploads/2020/04/013.png?resize=493%2C507&ssl=1)
![赤みがかったオレンジ](https://i0.wp.com/www.muscle-hypertrophy.com/wp-content/uploads/2020/04/014.png?resize=493%2C507&ssl=1)
![赤](https://i0.wp.com/www.muscle-hypertrophy.com/wp-content/uploads/2020/04/015.png?resize=493%2C507&ssl=1)
![赤紫](https://i0.wp.com/www.muscle-hypertrophy.com/wp-content/uploads/2020/04/016.png?resize=493%2C507&ssl=1)
![紫](https://i0.wp.com/www.muscle-hypertrophy.com/wp-content/uploads/2020/04/017.png?resize=493%2C507&ssl=1)
![紫 II](https://i0.wp.com/www.muscle-hypertrophy.com/wp-content/uploads/2020/04/018.png?resize=493%2C507&ssl=1)
![デザート](https://i0.wp.com/www.muscle-hypertrophy.com/wp-content/uploads/2020/04/019.png?resize=493%2C507&ssl=1)
![ペーパー](https://i0.wp.com/www.muscle-hypertrophy.com/wp-content/uploads/2020/04/020.png?resize=493%2C507&ssl=1)
![マーキー](https://i0.wp.com/www.muscle-hypertrophy.com/wp-content/uploads/2020/04/021.png?resize=493%2C507&ssl=1)
![スリップストリーム](https://i0.wp.com/www.muscle-hypertrophy.com/wp-content/uploads/2020/04/022.png?resize=493%2C507&ssl=1)
![シック](https://i0.wp.com/www.muscle-hypertrophy.com/wp-content/uploads/2020/04/023.png?resize=493%2C507&ssl=1)
配色パターンを RGB 関数で表現する
さて,前回同様に配色パターン一つ一つを RGB 関数で表現してみよう.まずは VBA でコードを表現する.
Sub ThemeColor(Path As String) Dim mySht As Worksheet Dim myFileName As String Dim i As Long Dim myThmClrSchm As ThemeColorScheme Dim myRGB As Long Dim myR As Long Dim myG As Long Dim myB As Long myFileName = Dir(Path) Set mySht = Worksheets.Add Set myThmClrSchm = ThisWorkbook.Theme.ThemeColorScheme For i = 1 To 12 myRGB = myThmClrSchm.Colors(i).RGB myB = Int(myRGB / 65536) myG = Int((myRGB - (myB * 65536)) / 256) myR = myRGB - (myG * 256) - (myB * 65536) With mySht .Cells(i, 1) = Dir(Path) .Cells(i, 2) = myThmClrSchm.Colors(i).ThemeColorSchemeIndex .Cells(i, 3) = myRGB .Cells(i, 4) = myB .Cells(i, 5) = myG .Cells(i, 6) = myR End With Next i End Sub
次に,上記コードを呼び出すコードを書く.
Sub WriteToSheet() Dim mySht As Worksheet Dim myLstObj As ListObject Dim myPath As String Dim i As Long Set mySht = Worksheets("Sheet1") Set myLstObj = mySht.ListObjects.Item(mySht.ListObjects.Count) For i = 2 To myLstObj.Range.Rows.Count - 1 myPath = Intersect(myLstObj.ListRows(i).Range, myLstObj.ListColumns(4).Range).Value 'Debug.Print myPath Call ThemeColor(myPath) Next i End Sub
F5 キーを押下して WriteToSheet を実行する.ワークシートが追加され,一枚ごとに配色一つについてのオブジェクトテーマカラー 12 種類の RGB 関数の結果が取得される.
結果
結果を pre タグで囲む.ファイル名,ThemeColorSchemeIndex, RGB, B, G, R の順に記載してある.
Office 2007 - 2010.xml 1 0 0 0 0 Office 2007 - 2010.xml 2 16777215 255 255 255 Office 2007 - 2010.xml 3 3289650 50 50 50 Office 2007 - 2010.xml 4 13754083 209 222 227 Office 2007 - 2010.xml 5 622576 9 127 240 Office 2007 - 2010.xml 6 3549599 54 41 159 Office 2007 - 2010.xml 7 8149019 124 88 27 Office 2007 - 2010.xml 8 4359502 66 133 78 Office 2007 - 2010.xml 9 7882848 120 72 96 Office 2007 - 2010.xml 10 5871809 89 152 193 Office 2007 - 2010.xml 11 2465643 37 159 107 Office 2007 - 2010.xml 12 158642 2 107 178 Grayscale.xml 1 0 0 0 0 Grayscale.xml 2 16777215 255 255 255 Grayscale.xml 3 3289650 50 50 50 Grayscale.xml 4 13754083 209 222 227 Grayscale.xml 5 622576 9 127 240 Grayscale.xml 6 3549599 54 41 159 Grayscale.xml 7 8149019 124 88 27 Grayscale.xml 8 4359502 66 133 78 Grayscale.xml 9 7882848 120 72 96 Grayscale.xml 10 5871809 89 152 193 Grayscale.xml 11 2465643 37 159 107 Grayscale.xml 12 158642 2 107 178 Blue Warm.xml 1 0 0 0 0 Blue Warm.xml 2 16777215 255 255 255 Blue Warm.xml 3 3289650 50 50 50 Blue Warm.xml 4 13754083 209 222 227 Blue Warm.xml 5 622576 9 127 240 Blue Warm.xml 6 3549599 54 41 159 Blue Warm.xml 7 8149019 124 88 27 Blue Warm.xml 8 4359502 66 133 78 Blue Warm.xml 9 7882848 120 72 96 Blue Warm.xml 10 5871809 89 152 193 Blue Warm.xml 11 2465643 37 159 107 Blue Warm.xml 12 158642 2 107 178 Blue.xml 1 0 0 0 0 Blue.xml 2 16777215 255 255 255 Blue.xml 3 3289650 50 50 50 Blue.xml 4 13754083 209 222 227 Blue.xml 5 622576 9 127 240 Blue.xml 6 3549599 54 41 159 Blue.xml 7 8149019 124 88 27 Blue.xml 8 4359502 66 133 78 Blue.xml 9 7882848 120 72 96 Blue.xml 10 5871809 89 152 193 Blue.xml 11 2465643 37 159 107 Blue.xml 12 158642 2 107 178 Blue II.xml 1 0 0 0 0 Blue II.xml 2 16777215 255 255 255 Blue II.xml 3 3289650 50 50 50 Blue II.xml 4 13754083 209 222 227 Blue II.xml 5 622576 9 127 240 Blue II.xml 6 3549599 54 41 159 Blue II.xml 7 8149019 124 88 27 Blue II.xml 8 4359502 66 133 78 Blue II.xml 9 7882848 120 72 96 Blue II.xml 10 5871809 89 152 193 Blue II.xml 11 2465643 37 159 107 Blue II.xml 12 158642 2 107 178 Blue Green.xml 1 0 0 0 0 Blue Green.xml 2 16777215 255 255 255 Blue Green.xml 3 3289650 50 50 50 Blue Green.xml 4 13754083 209 222 227 Blue Green.xml 5 622576 9 127 240 Blue Green.xml 6 3549599 54 41 159 Blue Green.xml 7 8149019 124 88 27 Blue Green.xml 8 4359502 66 133 78 Blue Green.xml 9 7882848 120 72 96 Blue Green.xml 10 5871809 89 152 193 Blue Green.xml 11 2465643 37 159 107 Blue Green.xml 12 158642 2 107 178 Green.xml 1 0 0 0 0 Green.xml 2 16777215 255 255 255 Green.xml 3 3289650 50 50 50 Green.xml 4 13754083 209 222 227 Green.xml 5 622576 9 127 240 Green.xml 6 3549599 54 41 159 Green.xml 7 8149019 124 88 27 Green.xml 8 4359502 66 133 78 Green.xml 9 7882848 120 72 96 Green.xml 10 5871809 89 152 193 Green.xml 11 2465643 37 159 107 Green.xml 12 158642 2 107 178 Green Yellow.xml 1 0 0 0 0 Green Yellow.xml 2 16777215 255 255 255 Green Yellow.xml 3 3289650 50 50 50 Green Yellow.xml 4 13754083 209 222 227 Green Yellow.xml 5 622576 9 127 240 Green Yellow.xml 6 3549599 54 41 159 Green Yellow.xml 7 8149019 124 88 27 Green Yellow.xml 8 4359502 66 133 78 Green Yellow.xml 9 7882848 120 72 96 Green Yellow.xml 10 5871809 89 152 193 Green Yellow.xml 11 2465643 37 159 107 Green Yellow.xml 12 158642 2 107 178 Yellow.xml 1 0 0 0 0 Yellow.xml 2 16777215 255 255 255 Yellow.xml 3 3289650 50 50 50 Yellow.xml 4 13754083 209 222 227 Yellow.xml 5 622576 9 127 240 Yellow.xml 6 3549599 54 41 159 Yellow.xml 7 8149019 124 88 27 Yellow.xml 8 4359502 66 133 78 Yellow.xml 9 7882848 120 72 96 Yellow.xml 10 5871809 89 152 193 Yellow.xml 11 2465643 37 159 107 Yellow.xml 12 158642 2 107 178 Yellow Orange.xml 1 0 0 0 0 Yellow Orange.xml 2 16777215 255 255 255 Yellow Orange.xml 3 3289650 50 50 50 Yellow Orange.xml 4 13754083 209 222 227 Yellow Orange.xml 5 622576 9 127 240 Yellow Orange.xml 6 3549599 54 41 159 Yellow Orange.xml 7 8149019 124 88 27 Yellow Orange.xml 8 4359502 66 133 78 Yellow Orange.xml 9 7882848 120 72 96 Yellow Orange.xml 10 5871809 89 152 193 Yellow Orange.xml 11 2465643 37 159 107 Yellow Orange.xml 12 158642 2 107 178 Orange.xml 1 0 0 0 0 Orange.xml 2 16777215 255 255 255 Orange.xml 3 3289650 50 50 50 Orange.xml 4 13754083 209 222 227 Orange.xml 5 622576 9 127 240 Orange.xml 6 3549599 54 41 159 Orange.xml 7 8149019 124 88 27 Orange.xml 8 4359502 66 133 78 Orange.xml 9 7882848 120 72 96 Orange.xml 10 5871809 89 152 193 Orange.xml 11 2465643 37 159 107 Orange.xml 12 158642 2 107 178 Orange Red.xml 1 0 0 0 0 Orange Red.xml 2 16777215 255 255 255 Orange Red.xml 3 3289650 50 50 50 Orange Red.xml 4 13754083 209 222 227 Orange Red.xml 5 622576 9 127 240 Orange Red.xml 6 3549599 54 41 159 Orange Red.xml 7 8149019 124 88 27 Orange Red.xml 8 4359502 66 133 78 Orange Red.xml 9 7882848 120 72 96 Orange Red.xml 10 5871809 89 152 193 Orange Red.xml 11 2465643 37 159 107 Orange Red.xml 12 158642 2 107 178 Red Orange.xml 1 0 0 0 0 Red Orange.xml 2 16777215 255 255 255 Red Orange.xml 3 3289650 50 50 50 Red Orange.xml 4 13754083 209 222 227 Red Orange.xml 5 622576 9 127 240 Red Orange.xml 6 3549599 54 41 159 Red Orange.xml 7 8149019 124 88 27 Red Orange.xml 8 4359502 66 133 78 Red Orange.xml 9 7882848 120 72 96 Red Orange.xml 10 5871809 89 152 193 Red Orange.xml 11 2465643 37 159 107 Red Orange.xml 12 158642 2 107 178 Red.xml 1 0 0 0 0 Red.xml 2 16777215 255 255 255 Red.xml 3 3289650 50 50 50 Red.xml 4 13754083 209 222 227 Red.xml 5 622576 9 127 240 Red.xml 6 3549599 54 41 159 Red.xml 7 8149019 124 88 27 Red.xml 8 4359502 66 133 78 Red.xml 9 7882848 120 72 96 Red.xml 10 5871809 89 152 193 Red.xml 11 2465643 37 159 107 Red.xml 12 158642 2 107 178 Red Violet.xml 1 0 0 0 0 Red Violet.xml 2 16777215 255 255 255 Red Violet.xml 3 3289650 50 50 50 Red Violet.xml 4 13754083 209 222 227 Red Violet.xml 5 622576 9 127 240 Red Violet.xml 6 3549599 54 41 159 Red Violet.xml 7 8149019 124 88 27 Red Violet.xml 8 4359502 66 133 78 Red Violet.xml 9 7882848 120 72 96 Red Violet.xml 10 5871809 89 152 193 Red Violet.xml 11 2465643 37 159 107 Red Violet.xml 12 158642 2 107 178 Violet.xml 1 0 0 0 0 Violet.xml 2 16777215 255 255 255 Violet.xml 3 3289650 50 50 50 Violet.xml 4 13754083 209 222 227 Violet.xml 5 622576 9 127 240 Violet.xml 6 3549599 54 41 159 Violet.xml 7 8149019 124 88 27 Violet.xml 8 4359502 66 133 78 Violet.xml 9 7882848 120 72 96 Violet.xml 10 5871809 89 152 193 Violet.xml 11 2465643 37 159 107 Violet.xml 12 158642 2 107 178 Violet II.xml 1 0 0 0 0 Violet II.xml 2 16777215 255 255 255 Violet II.xml 3 3289650 50 50 50 Violet II.xml 4 13754083 209 222 227 Violet II.xml 5 622576 9 127 240 Violet II.xml 6 3549599 54 41 159 Violet II.xml 7 8149019 124 88 27 Violet II.xml 8 4359502 66 133 78 Violet II.xml 9 7882848 120 72 96 Violet II.xml 10 5871809 89 152 193 Violet II.xml 11 2465643 37 159 107 Violet II.xml 12 158642 2 107 178 Median.xml 1 0 0 0 0 Median.xml 2 16777215 255 255 255 Median.xml 3 3289650 50 50 50 Median.xml 4 13754083 209 222 227 Median.xml 5 622576 9 127 240 Median.xml 6 3549599 54 41 159 Median.xml 7 8149019 124 88 27 Median.xml 8 4359502 66 133 78 Median.xml 9 7882848 120 72 96 Median.xml 10 5871809 89 152 193 Median.xml 11 2465643 37 159 107 Median.xml 12 158642 2 107 178 Paper.xml 1 0 0 0 0 Paper.xml 2 16777215 255 255 255 Paper.xml 3 3289650 50 50 50 Paper.xml 4 13754083 209 222 227 Paper.xml 5 622576 9 127 240 Paper.xml 6 3549599 54 41 159 Paper.xml 7 8149019 124 88 27 Paper.xml 8 4359502 66 133 78 Paper.xml 9 7882848 120 72 96 Paper.xml 10 5871809 89 152 193 Paper.xml 11 2465643 37 159 107 Paper.xml 12 158642 2 107 178 Marquee.xml 1 0 0 0 0 Marquee.xml 2 16777215 255 255 255 Marquee.xml 3 3289650 50 50 50 Marquee.xml 4 13754083 209 222 227 Marquee.xml 5 622576 9 127 240 Marquee.xml 6 3549599 54 41 159 Marquee.xml 7 8149019 124 88 27 Marquee.xml 8 4359502 66 133 78 Marquee.xml 9 7882848 120 72 96 Marquee.xml 10 5871809 89 152 193 Marquee.xml 11 2465643 37 159 107 Marquee.xml 12 158642 2 107 178 Slipstream.xml 1 0 0 0 0 Slipstream.xml 2 16777215 255 255 255 Slipstream.xml 3 3289650 50 50 50 Slipstream.xml 4 13754083 209 222 227 Slipstream.xml 5 622576 9 127 240 Slipstream.xml 6 3549599 54 41 159 Slipstream.xml 7 8149019 124 88 27 Slipstream.xml 8 4359502 66 133 78 Slipstream.xml 9 7882848 120 72 96 Slipstream.xml 10 5871809 89 152 193 Slipstream.xml 11 2465643 37 159 107 Slipstream.xml 12 158642 2 107 178 Aspect.xml 1 0 0 0 0 Aspect.xml 2 16777215 255 255 255 Aspect.xml 3 3289650 50 50 50 Aspect.xml 4 13754083 209 222 227 Aspect.xml 5 622576 9 127 240 Aspect.xml 6 3549599 54 41 159 Aspect.xml 7 8149019 124 88 27 Aspect.xml 8 4359502 66 133 78 Aspect.xml 9 7882848 120 72 96 Aspect.xml 10 5871809 89 152 193 Aspect.xml 11 2465643 37 159 107 Aspect.xml 12 158642 2 107 178
“Office テーマの配色を RGB 関数で表現する” への1件の返信