言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

Color

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

RGBA カラーの表現をします。

この構造は色を扱うためにUnity全体で使用されます。 各色成分は0から1の範囲でfloat値となります。 成分 (r,g,b) はRGB色空間で定義されます。 アルファ成分 (a)は透明度が定義されています。 - アルファが0の場合は完全に不透明、アルファが1の場合は完全に 透明です。

Static Variables

black 黒色。RGBA は (0, 0, 0, 1)
blue 青色。RGBA は (0, 0, 1, 1)
clear RGBA を (0, 0, 0, 0) にします。
cyan シアン。RGBA は (0, 1, 1, 1)
gray 灰色。RGBA は (0.5, 0.5, 0.5, 1)
green ソリッドグリーン。RGBA は (0, 1, 0, 1)
grey grayと一緒。RGBA は (0.5, 0.5, 0.5, 1)
magenta マジェンタ。RGBA は (1, 0, 1, 1)
red 赤色。RGBA は (1, 0, 0, 1)
white 白色。RGBA は (1, 1, 1, 1)
yellow 黄色。RGBA は (1, 0.92, 0.016, 1)

Variables

a アルファ成分
b 青成分
g 緑成分
gamma ガンマを適用した色を返します。
grayscale グレースケールが格納されている(読み込み専用)
linear 逆ガンマを適用した色を返します。
r 赤成分
this[int] rは [0]、gは [1]、bは [2]、aは[3]に格納されます。

Constructors

Color r,g,b,a成分からColorを作成します。

Functions

ToString この色の情報を表す整形された文字列を返します。

Static Functions

Lerp A 色からB 色への変更というような色の変換を行います。

Operators

Color ColorはVector4から暗黙的に変換することが出来ます。
operator - Color b を Color a で減算します。各色成分は個別にスケーリングされます。
operator * 2つのColorを乗算します。各色成分は個別にスケーリングされます。
operator / Color a をfloat値 b で割ります。各色成分は個別にスケーリングされます。
operator + 2つの色を加算します。各成分のコンポーネントは個別に加算されます。
Vector4 ColorはVector4から暗黙的に変換することが出来ます。