{{newin (日本語)|[[0.10.0 (日本語)|0.10.0]]|100|type=関数}}
Sends one or more colors to a special (''extern'' / ''uniform'') vec3 or vec4 variable inside the shader. The color components must be in the range of [0, 1]. The colors are gamma-corrected if global [[love.graphics.isGammaCorrect|gamma-correction]] is enabled.

Extern variables must be marked using the ''extern'' keyword, e.g.

<source lang="glsl">
extern vec4 Color;
</source>

The corresponding sendColor call would be

<source lang="lua">
shader:sendColor("Color", {r, g, b, a})
</source>


Extern variables can be accessed in both the Vertex and Pixel stages of a shader, as long as the variable is declared in each.

バージョン [[11.0 (日本語)|11.0]] まで、色成分値は 0 〜 1 (小数値) ではなく 0 〜 255 (整数値) の範囲内です。

== 関数 ==
=== 概要 ===
<source lang="lua">
Shader:sendColor( name, color, ... )
</source>
=== 引数 ===
{{param (日本語)|string|name|The name of the color extern variable to send to in the shader.}}
{{param (日本語)|table|color|A table with red, green, blue, and optional alpha color components in the range of [0, 1] to send to the extern as a vector.}}
{{param (日本語)|table|...|Additional colors to send in case the extern is an array. All colors need to be of the same size (e.g. only vec3's).}}
=== 返値 ===
ありません。

== 関連 ==
* [[parent::Shader (日本語)]]
* [[Shader:send (日本語)]]
[[Category:Functions (日本語)]]
{{#set:Description=Sends one or more colors to the shader.}}
== そのほかの言語 ==
{{i18n (日本語)|Shader:sendColor}}