diff --git a/docs/api/en/math/Color.html b/docs/api/en/math/Color.html index 408ced10806d74..8c3f215a432434 100644 --- a/docs/api/en/math/Color.html +++ b/docs/api/en/math/Color.html @@ -12,7 +12,41 @@

[name]

Class representing a color.

- Iterating through a [name] instance will yield its components (r, g, b) in + A Color instance is represented by RGB components in the linear working + color space, which defaults to `LinearSRGBColorSpace`. Inputs + conventionally using `SRGBColorSpace` (such as hexadecimals and CSS + strings) are converted to the working color space automatically. +

+ +

+ +// converted automically from SRGBColorSpace to LinearSRGBColorSpace +const color = new THREE.Color().setHex( 0x112233 ); + +

+ +

+ Source color spaces may be specified explicitly, to ensure correct + conversions. +

+ +

+ +// assumed already LinearSRGBColorSpace; no conversion +const color = new THREE.Color().setRGB( 0.5, 0.5, 0.5 ); + +// converted explicitly from SRGBColorSpace to LinearSRGBColorSpace +const color = new THREE.Color().setRGB( 0.5, 0.5, 0.5, SRGBColorSpace ); + +

+ +

+ If THREE.ColorManagement is disabled, no conversions occur. For details, + see Color management. +

+ +

+ Iterating through a Color instance will yield its components (r, g, b) in the corresponding order.

@@ -50,7 +84,7 @@

[page:Color_Hex_or_String r] - (optional) If arguments [page:Float g] and [page:Float b] are defined, the red component of the color. If they are not defined, it can be a - [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet hexadecimal triplet] (recommended), + [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet hexadecimal triplet] (recommended), a CSS-style string, or another `Color` instance.
[page:Float g] - (optional) If it is defined, the green component of the color.
@@ -58,7 +92,7 @@

color.

Note that standard method of specifying color in three.js is with a - [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet hexadecimal triplet], + [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet hexadecimal triplet], and that method is used throughout the rest of the documentation.

@@ -91,13 +125,13 @@

[property:Boolean isColor]

Read-only flag to check if a given object is of type [name].

[property:Float r]

-

Red channel value between `0` and `1`. Default is `1`.

+

Red channel value between `0.0` and `1.0`. Default is `1`.

[property:Float g]

-

Green channel value between `0` and `1`. Default is `1`.

+

Green channel value between `0.0` and `1.0`. Default is `1`.

[property:Float b]

-

Blue channel value between `0` and `1`. Default is `1`.

+

Blue channel value between `0.0` and `1.0`. Default is `1`.

Methods

@@ -134,17 +168,17 @@

[method:this copy]( [param:Color color] )

[method:this convertLinearToSRGB]()

-

Converts this color from linear space to sRGB space.

+

Converts this color from `LinearSRGBColorSpace` to `SRGBColorSpace`.

[method:this convertSRGBToLinear]()

-

Converts this color from sRGB space to linear space.

+

Converts this color from `SRGBColorSpace` to `LinearSRGBColorSpace`.

[method:this copyLinearToSRGB]( [param:Color color] )

[page:Color color] — Color to copy.
Copies the given color into this color, and then converts this color from - linear space to sRGB space. + `LinearSRGBColorSpace` to `SRGBColorSpace`.

[method:this copySRGBToLinear]( [param:Color color] )

@@ -152,7 +186,7 @@

[method:this copySRGBToLinear]( [param:Color color] )

[page:Color color] — Color to copy.
Copies the given color into this color, and then converts this color from - sRGB space to linear space. + `SRGBColorSpace` to `LinearSRGBColorSpace`.

[method:Boolean equals]( [param:Color color] )

@@ -208,11 +242,11 @@

object of the form: - { - h: 0, - s: 0, - l: 0 - } + { + h: 0, + s: 0, + l: 0 + }

@@ -253,9 +287,9 @@

[page:Float alpha] - interpolation factor, typically in the closed interval `[0, 1]`.

- Sets this color to be the color linearly interpolated between [page:Color color1] + Sets this color to be the color linearly interpolated between [page:Color color1] and [page:Color color2] where alpha is the percent distance along - the line connecting the two colors - alpha = 0 will be [page:Color color1], + the line connecting the two colors - alpha = 0 will be [page:Color color1], and alpha = 1 will be [page:Color color2].

diff --git a/docs/manual/en/introduction/Color-management.html b/docs/manual/en/introduction/Color-management.html index 72f158e625bbc9..088abde94531fc 100644 --- a/docs/manual/en/introduction/Color-management.html +++ b/docs/manual/en/introduction/Color-management.html @@ -165,6 +165,10 @@

Input color space

THREE.ColorManagement.enabled = true; +

+ THREE.ColorManagement is enabled by default. +

+