Difference between revisions of "Colors/ja"

From Free Pascal wiki
Jump to navigationJump to search
(Created page with "{{Colors}} {{Japanese Menu}} <br> =概要= The standard color in the LCL is TColor, which is compatible to Delphi's TColor. TColor can be an RGB, 3x8bit, value or a '''syste...")
 
m (Fixed syntax highlighting; deleted category included in page template)
 
(2 intermediate revisions by one other user not shown)
Line 5: Line 5:
 
=概要=
 
=概要=
  
The standard color in the LCL is TColor, which is compatible to Delphi's TColor. TColor can be an RGB, 3x8bit, value or a '''system''' color like '''clDefault'''. The LCL can work together with the fpImage system which uses the TFPColor (RGBA, 4x16bit).
+
TColor は LCL の標準色で Delphi TColor と互換性があります。TColor で RGB値(8 ビット×3)もしくは '''clDefault''' のような'''システム'''カラーを指定できます。また、LCL では TFPColor(RGBA、16 ビット×4)を使っている fpImage も共に使われています。
  
 
=TColor から RGB への変換と逆変換=
 
=TColor から RGB への変換と逆変換=
Line 11: Line 11:
 
ユニット '''Graphics''' は以下の関数を提供しています。
 
ユニット '''Graphics''' は以下の関数を提供しています。
  
<syntaxhighlight>function Blue(rgb: TColor): BYTE; // システムカラーでは動作しません
+
<syntaxhighlight lang=pascal>
 +
function Blue(rgb: TColor): BYTE; // システムカラーでは動作しません
 
function Green(rgb: TColor): BYTE; // システムカラーでは動作しません
 
function Green(rgb: TColor): BYTE; // システムカラーでは動作しません
 
function Red(rgb: TColor): BYTE; // システムカラーでは動作しません
 
function Red(rgb: TColor): BYTE; // システムカラーでは動作しません
Line 21: Line 22:
  
 
以下に示すように、あらかじめ定義されているカラー定数がいくつかあります。
 
以下に示すように、あらかじめ定義されているカラー定数がいくつかあります。
<syntaxhighlight> // 標準色
+
<syntaxhighlight lang=pascal>
 +
  // 標準色
 
   clBlack  = TColor($000000);
 
   clBlack  = TColor($000000);
 
   clMaroon  = TColor($000080);
 
   clMaroon  = TColor($000080);
Line 46: Line 48:
 
==例:clInfoBk、clInfoText==
 
==例:clInfoBk、clInfoText==
  
System colors are color constants with a special meaning. Their real value depends on the context and theme. They are not simple colors.
+
システムカラーは特別な意味を持ったカラー定数です。システムカラーの実際の色は状況やテーマに依存します。これらは単純な色ではありません。<br>
For example '''clInfoBk''':
+
例えば '''clInfoBk''' は、
  
<syntaxhighlight>Form1.Canvas.Brush.Color:=clInfoBk;  // use the default background brush of a hint window
+
<syntaxhighlight lang=pascal>
 +
Form1.Canvas.Brush.Color:=clInfoBk;  // ヒントウィンドウのデフォルトの背景ブラシを使用
 
Form1.Canvas.FillRect(10,10,50,50);</syntaxhighlight>
 
Form1.Canvas.FillRect(10,10,50,50);</syntaxhighlight>
  
A hint window on MS Windows might have a white background so the above will draw white. On Linux/gtk2 it might be a metallic texture, so the above will draw the texture. If you want to put some text onto this you need a corresponding color like '''clInfoText''', otherwise your text might be unreadable for the user. For example:
+
Windows でのヒントウィンドウは通常は白の背景なので、上記のは白で描画されます。Linux/GTK2 の場合、通常は金属風テクスチャなので、それで描画されます。これに文字も書き込むのであれば '''clInfoText''' などマッチする色を使う必要があるでしょう。そうしないとユーザにとって読みづらくなってしまうかもしれません。実際の記述例は以下のようなります。
  
<syntaxhighlight>Form1.Canvas.Brush.Color:=clInfoBk;  // use the default background brush of a hint window
+
<syntaxhighlight lang=pascal>
 +
Form1.Canvas.Brush.Color:=clInfoBk;  // ヒントウィンドウのデフォルトの背景ブラシを使用
 
Form1.Canvas.FillRect(10,10,50,50);
 
Form1.Canvas.FillRect(10,10,50,50);
Form1.Canvas.Font.Color:=clInfoText;  // use the default text color of a hint window
+
Form1.Canvas.Font.Color:=clInfoText;  // ヒントウィンドウのデフォルトの文字色を使用
 
Form1.Canvas.TextOut(10,10,'Hint');</syntaxhighlight>
 
Form1.Canvas.TextOut(10,10,'Hint');</syntaxhighlight>
  
The system color '''clInfoBk''' can not be used for Pen.Color and not for Font.Color. If you do so the result is undefined and depends on the widgetset and user theme.
+
システムカラー '''clInfoBk''' Pen.Color Font.Color に使用することはできません。使用しても決められた定義はされてなく、結果はウィジェットセットやユーザテーマに左右されるでしょう。<br>
The same for '''clInfoText''': It can only be used as a Font.Color. Using it as Brush.Color may not work. At the moment all widgetsets allow to use it as Pen.Color too.
+
'''clInfoText''' についても同様です。Font.Color にだけ使用でき、Brush.Color に使っても動作しないでしょう。なお現在では、Pen.Color としてならすべてのウィジェットセットで使うことができるようになっています。
  
 
==テーマの変更==
 
==テーマの変更==
  
When the user switches the theme the system colors changes. A '''clInfoBk''' might change from white to blue or from a color to a texture. This change will happen when you allocate a new Brush handle. Keep in mind that a simple assignment Brush.Color:=clInfoBk does not allocate a Brush Handle. The Brush Handle is allocated on use. For example:
+
ユーザがテーマを切り替えるとシステムカラーが変更されます。'''clInfoBk''' は白から青に変わるかもしれませんし、あるいは単純色からテクスチャに変更かもしれません。ブラシハンドルが新しく割り当てられたときに、この変更が反映されます。単純に Brush.Color:=clInfoBk と指定することではブラシハンドルが割り当てられないことを忘れてはなりません。実際に使うときになってからブラシハンドルは割り当てられるのです。以下に例を示します。
  
<syntaxhighlight>Form1.Canvas.Brush.Color:=clInfoBk; // this will not create a new brush handle
+
<syntaxhighlight lang=pascal>
Form1.Canvas.FillRect(10,10,50,50); // this will create the brush handle with the currently active theme brush for hint windows
+
Form1.Canvas.Brush.Color:=clInfoBk; // ここではブラシハンドルは作られていません
 +
Form1.Canvas.FillRect(10,10,50,50); // ここで現在のアクティブテーマのヒントウィンドウ用のブラシハンドルが作成されます
 
...
 
...
// if the theme changes in this moment the Brush.Handle is still allocated with the old values
+
// この間にテーマが変更されたとしても、ブラシハンドルはまだ古いままです
 
...
 
...
Form1.Canvas.FillRect(10,10,50,50); // this will paint with the old theme brush
+
Form1.Canvas.FillRect(10,10,50,50); // これは古いテーマブラシで描画されます
Form1.Canvas.Brush.Color:=clInfoBk; // assigning the old value will not create a new brush handle
+
Form1.Canvas.Brush.Color:=clInfoBk; // 古い値と同じ値を指定してもブラシハンドルは新しく作成されません
Form1.Canvas.FillRect(10,10,50,50); // this will paint with the old theme brush
+
Form1.Canvas.FillRect(10,10,50,50); // これも古いテーマブラシで描画されます
Form1.Canvas.Brush.Color:=clRed;    // assigning a new color, old Handle invalid
+
Form1.Canvas.Brush.Color:=clRed;    // 新たな色を指定すると古いハンドルは無効になります
Form1.Canvas.Brush.Color:=clInfoBk; // assigning a new color, old Handle invalid
+
Form1.Canvas.Brush.Color:=clInfoBk; // 改めて色を指定し直します
Form1.Canvas.FillRect(10,10,50,50); // this will create a new handle and paint with the new theme</syntaxhighlight>
+
Form1.Canvas.FillRect(10,10,50,50); // ブラシハンドルが新しく作られ、新しいテーマで描画されます</syntaxhighlight>
  
 
==システムカラーの一覧==
 
==システムカラーの一覧==
  
The following table lists the system colors and their meaning. Using them outside the scope of the definition is undefined and the result depends on the widgetset and theme. For example '''clDefault''' is the normal background brush of the used device context. If you want to paint button elements on your own custom controls use the drawing functions of the unit '''Themes'''.
+
以下の表はシステムカラーとその意味をまとめたものです。定義されている範囲外のテーマの使用に関しては定められてなく、結果はウィジェットセットとテーマに左右されます。例えば、'''clDefault''' は使用しているデバイスコンテキストの一般背景ブラシということです。カスタムコントロールをボタン要素で塗りたいのであれば、ユニット '''Themes''' の描画関数を使用してください。
  
 
{| class="wikitable"
 
{| class="wikitable"
! カラー定数 !! LCL definition !! Delphi notes !! ウィジェットセットのサポート状況
+
! カラー定数 !! LCL 定義 !! Delphi 注記 !! ウィジェットセットのサポート状況
 
|----
 
|----
|clNone||drawsnothing. Using it as Control's color is undefined. The control will not get transparent.|| - || 全部
+
|clNone||描画なし。コントロールの未定義色として使用されます。コントロールが透過するわけでありません。|| - || 全部
 
|----
 
|----
|clDefault||Using it for Brush will use the normal background brush of the target DC (device context).
+
|clDefault||ブラシとして使用した場合、対象の DC(デバイスコンテキスト)の一般背景ブラシを使用します。
* On a Form's canvas a ''FillRect'' will paint a rectangular area filled with the normal background of a standard window. This is whatever the widgetset and theme defines. This might be the color gray or a gradient or a picture.
+
* フォームのキャンバスで ''FillRect'' を使用した場合、標準ウィンドウの一般背景で矩形領域を塗りつぶします。これはウィジェットセットとテーマで定義されていて、通常は灰色、グラデーションもしくは画像が使われます。
* Using clDefault on the Canvas of a TListBox will paint with the normal background, which is normally white on Windows. So in a TListBox clDefault is the same as clWindow.
+
* TListBox のキャンバスで clDefault を使用した場合、一般背景で塗りつぶされます。Windows であれば通常は白です。つまり、TListBox では clDefault clWindow と同じことです。
* Using it as Pen color will use the default line color for the device context.
+
* ペン色として使用した場合、デバイスコンテキストのデフォルトの線色が使われます。
* Using it as Font color will use the normal text color of the device context.
+
* フォント色として使用した場合、デバイスコンテキストの一般文字色が使われます。
 
|| - || 全部
 
|| - || 全部
 
|----
 
|----
|clScrollBar|| Scrollbar body || - || 全部
+
|clScrollBar|| スクロールバー本体 || - || 全部
 
|----
 
|----
 
|clBackground|| ? || - || 全部
 
|clBackground|| ? || - || 全部
 
|----
 
|----
|clActiveCaption|| Active window titlebar || - || none
+
|clActiveCaption|| アクティブウィンドのタイトルバー || - || なし
 
|----
 
|----
|clInactiveCaption|| Inactive window titlebar || - || none
+
|clInactiveCaption|| 非アクティブウィンドのタイトルバー || - || なし
 
|----
 
|----
|clMenu|| Regular menu item background color || - || none
+
|clMenu|| 標準メニューアイテムの背景色 || - || なし
 
|----
 
|----
|clWindow|| The normal background brush of unselected text. Defined for controls like TEdit, TComboBox, TMemo, TListBox, TTreeView.|| - || none
+
|clWindow|| 選択されていない文字の一般背景ブラシ。TEdit、TComboBox、TMemo、TListBox、TTreeView などのコントロール用に定義されています。|| - || なし
 
|----
 
|----
|clWindowFrame|| Color of frame around the window || - || none
+
|clWindowFrame|| ウィンドウの周り、フレームの色 || - || なし
 
|----
 
|----
|clMenuText|| The font color to use together with clMenu || - || none
+
|clMenuText|| clMenu と共に使われるフォント色 || - || なし
 
|----
 
|----
|clWindowText|| Font color to use together with clWindow || - || none
+
|clWindowText|| clWindow と共に使われるフォント色 || - || なし
 
|----
 
|----
|clCaptionText|| Active window titlebar text color || - || none
+
|clCaptionText|| アクティブウィンドのタイトルバーの文字色 || - || なし
 
|----
 
|----
|clActiveBorder||?|| - || none
+
|clActiveBorder||?|| - || なし
 
|----
 
|----
|clInactiveBorder||?|| - || none
+
|clInactiveBorder||?|| - || なし
 
|----
 
|----
|clAppWorkspace|| MDI メインフォームの背景色 || - || none
+
|clAppWorkspace|| MDI メインフォームの背景色 || - || なし
 
|----
 
|----
|clHighlight|| The brush color of selected element || - || none
+
|clHighlight|| 選択要素のブラシ色 || - || なし
 
|----
 
|----
|clHighlightText|| Font color of selected text (to use together with clHighligh). || - || none
+
|clHighlightText|| 選択文字のフォント色(clHighligh と共に使用) || - || なし
 
|----
 
|----
|clBtnFace|| ボタンの背景色 || - || none
+
|clBtnFace|| ボタンの背景色 || - || なし
 
|----
 
|----
|clBtnShadow|| Button shadow color (bottom right) used to achieve 3D effect || - || none
+
|clBtnShadow|| アクティブの 3D エフェクトに使われているボタンの影の色(下と右側) || - || なし
 
|----
 
|----
|clGrayText|| The font color of disabled element || - || none
+
|clGrayText|| 無効要素のフォント色 || - || なし
 
|----
 
|----
|clBtnText|| Button font color to use together with clBtnFace || - || none
+
|clBtnText|| clBtnFace と共に使われるボタンのフォント色 || - || なし
 
|----
 
|----
|clInactiveCaptionText|| Inactive window titlebar text color || - || none
+
|clInactiveCaptionText|| 非アクティブウィンドのタイトルバーの文字色 || - || なし
 
|----
 
|----
|clBtnHighlight|| Button highlight color (top left) used to achieve 3D effect || - || none
+
|clBtnHighlight|| アクティブの 3D エフェクトに使われているボタンのハイライトの色(上と左側) || - || なし
 
|----
 
|----
|cl3DDkShadow||?|| - || none
+
|cl3DDkShadow||?|| - || なし
 
|----
 
|----
|cl3DLight||?|| - || none
+
|cl3DLight||?|| - || なし
 
|----
 
|----
|clInfoText|| Font color for hints. Use together with clInfoBk || - || 全部
+
|clInfoText|| ヒント用のフォント色。clInfoBk と共に使用。 || - || 全部
 
|----
 
|----
|clInfoBk|| Brush color for hints. Use together with clInfoText || - || 全部
+
|clInfoBk|| ヒント用のブラシ色。clInfoText と共に使用。 || - || 全部
 
|----
 
|----
|clHotLight||?|| - || none
+
|clHotLight||?|| - || なし
 
|----
 
|----
|clGradientActiveCaption|| The second color used to make gradient of active window titlebar || - || none
+
|clGradientActiveCaption|| アクティブウィンドウのタイトルバーのグラデーション作成時に使われるもう片方の色 || - || なし
 
|----
 
|----
|clGradientInactiveCaption|| The second color used to make gradient for inactive window titlebar || - || none
+
|clGradientInactiveCaption|| 非アクティブウィンドウのタイトルバーのグラデーション作成時に使われるもう片方の色 || - || なし
 
|----
 
|----
|clMenuHighlight|| 選択されているメニューアイテムの背景色 || - || none
+
|clMenuHighlight|| 選択されているメニューアイテムの背景色 || - || なし
 
|----
 
|----
|clMenuBar|| メニューバーの背景色 || - || none
+
|clMenuBar|| メニューバーの背景色 || - || なし
 
|----
 
|----
|clForm||?|| - || none
+
|clForm||?|| - || なし
 
|----
 
|----
|clColorDesktop||?|| - || none
+
|clColorDesktop||?|| - || なし
 
|----
 
|----
|cl3DFace||?|| - || none
+
|cl3DFace||?|| - || なし
 
|----
 
|----
|cl3DShadow||?|| - || none
+
|cl3DShadow||?|| - || なし
 
|----
 
|----
|cl3DHiLight||?|| - || none
+
|cl3DHiLight||?|| - || なし
 
|----
 
|----
|clBtnHiLight|| clBtnHighlight と同じ || - || none
+
|clBtnHiLight|| clBtnHighlight と同じ || - || なし
 
|}
 
|}
  
=Drawing theme elements on your custom controls=
+
=カスタムコントロールにテーマ要素を描画する=
  
The unit '''Themes''' provides functions to draw single elements of standard controls. For example to draw an expand sign like a TTreeView use the following code:
+
ユニット '''Themes''' は標準コントロールの画一された要素の描画のための関数を提供しています。例えば、TTreeView などの展開(+/-など)ボタンを描画するには、以下のようなコードを使用します。
  
<syntaxhighlight>uses Themes;
+
<syntaxhighlight lang=pascal>
 +
uses Themes;
  
 
...
 
...
Line 177: Line 183:
 
procedure TYourCustomControl.Paint;
 
procedure TYourCustomControl.Paint;
 
const
 
const
   PlusMinusDetail: array[Boolean {Hot}, Boolean {Expanded}] of TThemedTreeview =
+
   PlusMinusDetail: array[Boolean {強調表示}, Boolean {展開しているか}] of TThemedTreeview =
 
   (
 
   (
 
     (ttGlyphClosed, ttGlyphOpened),
 
     (ttGlyphClosed, ttGlyphOpened),
Line 188: Line 194:
 
begin
 
begin
 
   ...
 
   ...
   //draw a themed expand sign.
+
   //テーマに沿った展開ボタンを描画します。
 
   Details := ThemeServices.GetElementDetails(PlusMinusDetail[False, Collapse]);
 
   Details := ThemeServices.GetElementDetails(PlusMinusDetail[False, Collapse]);
 
   R := Rect(ALeft, ATop, ARight + 1, ABottom + 1);
 
   R := Rect(ALeft, ATop, ARight + 1, ABottom + 1);
Line 194: Line 200:
 
   ...
 
   ...
 
end;</syntaxhighlight>
 
end;</syntaxhighlight>
 
[[Category:Graphics/ja]]
 

Latest revision as of 06:59, 11 February 2020

Deutsch (de) English (en) español (es) suomi (fi) français (fr) 日本語 (ja) русский (ru) 中文(中国大陆)‎ (zh_CN)

日本語版メニュー
メインページ - Lazarus Documentation日本語版 - 翻訳ノート - 日本語障害情報


概要

TColor は LCL の標準色で Delphi の TColor と互換性があります。TColor で RGB値(8 ビット×3)もしくは clDefault のようなシステムカラーを指定できます。また、LCL では TFPColor(RGBA、16 ビット×4)を使っている fpImage も共に使われています。

TColor から RGB への変換と逆変換

ユニット Graphics は以下の関数を提供しています。

function Blue(rgb: TColor): BYTE; // システムカラーでは動作しません
function Green(rgb: TColor): BYTE; // システムカラーでは動作しません
function Red(rgb: TColor): BYTE; // システムカラーでは動作しません
function RGBToColor(R, G, B: Byte): TColor;
procedure RedGreenBlue(rgb: TColor; out Red, Green, Blue: Byte); // システムカラーでは動作しません
function FPColorToTColor(const FPColor: TFPColor): TColor;
function TColorToFPColor(const c: TColor): TFPColor; // システムカラーでは動作しません


以下に示すように、あらかじめ定義されているカラー定数がいくつかあります。

  // 標準色
  clBlack   = TColor($000000);
  clMaroon  = TColor($000080);
  clGreen   = TColor($008000);
  clOlive   = TColor($008080);
  clNavy    = TColor($800000);
  clPurple  = TColor($800080);
  clTeal    = TColor($808000);
  clGray    = TColor($808080);
  clSilver  = TColor($C0C0C0);
  clRed     = TColor($0000FF);
  clLime    = TColor($00FF00);
  clYellow  = TColor($00FFFF);
  clBlue    = TColor($FF0000);
  clFuchsia = TColor($FF00FF);
  clAqua    = TColor($FFFF00);
  clLtGray  = TColor($C0C0C0); // clSilver の別名
  clDkGray  = TColor($808080); // clGray の別名
  clWhite   = TColor($FFFFFF);


システムカラー

例:clInfoBk、clInfoText

システムカラーは特別な意味を持ったカラー定数です。システムカラーの実際の色は状況やテーマに依存します。これらは単純な色ではありません。
例えば clInfoBk は、

Form1.Canvas.Brush.Color:=clInfoBk;  // ヒントウィンドウのデフォルトの背景ブラシを使用
Form1.Canvas.FillRect(10,10,50,50);

Windows でのヒントウィンドウは通常は白の背景なので、上記のは白で描画されます。Linux/GTK2 の場合、通常は金属風テクスチャなので、それで描画されます。これに文字も書き込むのであれば clInfoText などマッチする色を使う必要があるでしょう。そうしないとユーザにとって読みづらくなってしまうかもしれません。実際の記述例は以下のようなります。

Form1.Canvas.Brush.Color:=clInfoBk;  // ヒントウィンドウのデフォルトの背景ブラシを使用
Form1.Canvas.FillRect(10,10,50,50);
Form1.Canvas.Font.Color:=clInfoText;  // ヒントウィンドウのデフォルトの文字色を使用
Form1.Canvas.TextOut(10,10,'Hint');

システムカラー clInfoBk は Pen.Color と Font.Color に使用することはできません。使用しても決められた定義はされてなく、結果はウィジェットセットやユーザテーマに左右されるでしょう。
clInfoText についても同様です。Font.Color にだけ使用でき、Brush.Color に使っても動作しないでしょう。なお現在では、Pen.Color としてならすべてのウィジェットセットで使うことができるようになっています。

テーマの変更

ユーザがテーマを切り替えるとシステムカラーが変更されます。clInfoBk は白から青に変わるかもしれませんし、あるいは単純色からテクスチャに変更かもしれません。ブラシハンドルが新しく割り当てられたときに、この変更が反映されます。単純に Brush.Color:=clInfoBk と指定することではブラシハンドルが割り当てられないことを忘れてはなりません。実際に使うときになってからブラシハンドルは割り当てられるのです。以下に例を示します。

Form1.Canvas.Brush.Color:=clInfoBk; // ここではブラシハンドルは作られていません
Form1.Canvas.FillRect(10,10,50,50); // ここで現在のアクティブテーマのヒントウィンドウ用のブラシハンドルが作成されます
...
// この間にテーマが変更されたとしても、ブラシハンドルはまだ古いままです
...
Form1.Canvas.FillRect(10,10,50,50); // これは古いテーマブラシで描画されます
Form1.Canvas.Brush.Color:=clInfoBk; // 古い値と同じ値を指定してもブラシハンドルは新しく作成されません
Form1.Canvas.FillRect(10,10,50,50); // これも古いテーマブラシで描画されます
Form1.Canvas.Brush.Color:=clRed;    // 新たな色を指定すると古いハンドルは無効になります
Form1.Canvas.Brush.Color:=clInfoBk; // 改めて色を指定し直します
Form1.Canvas.FillRect(10,10,50,50); // ブラシハンドルが新しく作られ、新しいテーマで描画されます

システムカラーの一覧

以下の表はシステムカラーとその意味をまとめたものです。定義されている範囲外のテーマの使用に関しては定められてなく、結果はウィジェットセットとテーマに左右されます。例えば、clDefault は使用しているデバイスコンテキストの一般背景ブラシということです。カスタムコントロールをボタン要素で塗りたいのであれば、ユニット Themes の描画関数を使用してください。

カラー定数 LCL 定義 Delphi 注記 ウィジェットセットのサポート状況
clNone 描画なし。コントロールの未定義色として使用されます。コントロールが透過するわけでありません。 - 全部
clDefault ブラシとして使用した場合、対象の DC(デバイスコンテキスト)の一般背景ブラシを使用します。
  • フォームのキャンバスで FillRect を使用した場合、標準ウィンドウの一般背景で矩形領域を塗りつぶします。これはウィジェットセットとテーマで定義されていて、通常は灰色、グラデーションもしくは画像が使われます。
  • TListBox のキャンバスで clDefault を使用した場合、一般背景で塗りつぶされます。Windows であれば通常は白です。つまり、TListBox では clDefault は clWindow と同じことです。
  • ペン色として使用した場合、デバイスコンテキストのデフォルトの線色が使われます。
  • フォント色として使用した場合、デバイスコンテキストの一般文字色が使われます。
- 全部
clScrollBar スクロールバー本体 - 全部
clBackground ? - 全部
clActiveCaption アクティブウィンドのタイトルバー - なし
clInactiveCaption 非アクティブウィンドのタイトルバー - なし
clMenu 標準メニューアイテムの背景色 - なし
clWindow 選択されていない文字の一般背景ブラシ。TEdit、TComboBox、TMemo、TListBox、TTreeView などのコントロール用に定義されています。 - なし
clWindowFrame ウィンドウの周り、フレームの色 - なし
clMenuText clMenu と共に使われるフォント色 - なし
clWindowText clWindow と共に使われるフォント色 - なし
clCaptionText アクティブウィンドのタイトルバーの文字色 - なし
clActiveBorder ? - なし
clInactiveBorder ? - なし
clAppWorkspace MDI メインフォームの背景色 - なし
clHighlight 選択要素のブラシ色 - なし
clHighlightText 選択文字のフォント色(clHighligh と共に使用) - なし
clBtnFace ボタンの背景色 - なし
clBtnShadow アクティブの 3D エフェクトに使われているボタンの影の色(下と右側) - なし
clGrayText 無効要素のフォント色 - なし
clBtnText clBtnFace と共に使われるボタンのフォント色 - なし
clInactiveCaptionText 非アクティブウィンドのタイトルバーの文字色 - なし
clBtnHighlight アクティブの 3D エフェクトに使われているボタンのハイライトの色(上と左側) - なし
cl3DDkShadow ? - なし
cl3DLight ? - なし
clInfoText ヒント用のフォント色。clInfoBk と共に使用。 - 全部
clInfoBk ヒント用のブラシ色。clInfoText と共に使用。 - 全部
clHotLight ? - なし
clGradientActiveCaption アクティブウィンドウのタイトルバーのグラデーション作成時に使われるもう片方の色 - なし
clGradientInactiveCaption 非アクティブウィンドウのタイトルバーのグラデーション作成時に使われるもう片方の色 - なし
clMenuHighlight 選択されているメニューアイテムの背景色 - なし
clMenuBar メニューバーの背景色 - なし
clForm ? - なし
clColorDesktop ? - なし
cl3DFace ? - なし
cl3DShadow ? - なし
cl3DHiLight ? - なし
clBtnHiLight clBtnHighlight と同じ - なし

カスタムコントロールにテーマ要素を描画する

ユニット Themes は標準コントロールの画一された要素の描画のための関数を提供しています。例えば、TTreeView などの展開(+/-など)ボタンを描画するには、以下のようなコードを使用します。

uses Themes;

...

procedure TYourCustomControl.Paint;
const
  PlusMinusDetail: array[Boolean {強調表示}, Boolean {展開しているか}] of TThemedTreeview =
  (
    (ttGlyphClosed, ttGlyphOpened),
    (ttHotGlyphClosed, ttHotGlyphOpened)
  );
var
  Details: TThemedElementDetails;
  R: TRect;
  Collapse: boolean;
begin
  ...
  //テーマに沿った展開ボタンを描画します。
  Details := ThemeServices.GetElementDetails(PlusMinusDetail[False, Collapse]);
  R := Rect(ALeft, ATop, ARight + 1, ABottom + 1);
  ThemeServices.DrawElement(Canvas.Handle, Details, R, nil);
  ...
end;