Information.RGB(Int32, Int32, Int32) メソッド

定義

赤、緑、青の色コンポーネントのセットから RGB カラー値を表す Integer 値を返します。

public:
 static int RGB(int Red, int Green, int Blue);
public static int RGB(int Red, int Green, int Blue);
static member RGB : int * int * int -> int
Public Function RGB (Red As Integer, Green As Integer, Blue As Integer) As Integer

パラメーター

Red
Int32

必須。 Integer 0 ~ 255 の範囲で、色の赤成分の強度を表します。

Green
Int32

必須。 Integer 0 から 255 の範囲で、色の緑色の成分の強度を表します。

Blue
Int32

必須。 Integer 0 から 255 の範囲で、色の青色成分の強度を表します。

返品

赤、緑、青の色コンポーネントのセットから RGB カラー値を表す Integer 値を返します。

例外

GreenBlue、または Red が 0 ~ 255 の範囲外です。

この例では、 RGB 関数を使用して、 RGB 色の値を表す整数を返す方法を示します。

Dim red, rgbValue As Integer
Dim i As Integer = 75
' Return the value for red.
red = RGB(255, 0, 0)
' Same as RGB(75, 139, 203).
rgbValue = RGB(i, 64 + i, 128 + i)

注釈

色の指定を受け付けるアプリケーションのメソッドやプロパティは、RGB カラー値を表す数値で指定されることを想定します。 RGB カラー値は、特定の色を表示する赤、緑、青の相対的な強度を指定します。

RGBする引数の値が 255 より大きい場合は、255 が使用されます。

次の表に、標準の色と、その色に含まれる赤、緑、青の値を示します。

カラー 赤の値 緑の値 青の値
0 0 0
0 0 255
[緑] 0 255 0
シアン 0 255 255
Red 255 0 0
マジェンタ 255 0 255
255 255 0
白い 255 255 255

適用対象

こちらもご覧ください