|
@@ -96,46 +96,46 @@ const color7 = new THREE.Color( 1, 0, 0 );
|
|
|
|
|
|
<h2>Methods</h2>
|
|
|
|
|
|
- <h3>[method:Color add]( [param:Color color] ) </h3>
|
|
|
+ <h3>[method:this add]( [param:Color color] ) </h3>
|
|
|
<p>Adds the RGB values of [page:Color color] to the RGB values of this color.</p>
|
|
|
|
|
|
- <h3>[method:Color addColors]( [param:Color color1], [param:Color color2] ) </h3>
|
|
|
+ <h3>[method:this addColors]( [param:Color color1], [param:Color color2] ) </h3>
|
|
|
<p>Sets this color's RGB values to the sum of the RGB values of [page:Color color1] and [page:Color color2].</p>
|
|
|
|
|
|
- <h3>[method:Color addScalar]( [param:Number s] ) </h3>
|
|
|
+ <h3>[method:this addScalar]( [param:Number s] ) </h3>
|
|
|
<p>Adds [page:Number s] to the RGB values of this color.</p>
|
|
|
|
|
|
<h3>[method:Color clone]() </h3>
|
|
|
<p>Returns a new Color with the same [page:.r r], [page:.g g] and [page:.b b] values as this one.</p>
|
|
|
|
|
|
- <h3>[method:Color copy]( [param:Color color] ) </h3>
|
|
|
+ <h3>[method:this copy]( [param:Color color] ) </h3>
|
|
|
<p>
|
|
|
Copies the [page:.r r], [page:.g g] and [page:.b b] parameters from [page:Color color] in to this color.
|
|
|
</p>
|
|
|
|
|
|
- <h3>[method:Color convertGammaToLinear]( [param:Float gammaFactor] ) </h3>
|
|
|
+ <h3>[method:this convertGammaToLinear]( [param:Float gammaFactor] ) </h3>
|
|
|
<p>
|
|
|
[page:Float gammaFactor] - (optional). Default is *2.0*.<br /><br />
|
|
|
Converts this color from gamma space to linear space by taking [page:.r r], [page:.g g] and [page:.b b] to the power of [page:Float gammaFactor].
|
|
|
</p>
|
|
|
|
|
|
- <h3>[method:Color convertLinearToGamma]( [param:Float gammaFactor] ) </h3>
|
|
|
+ <h3>[method:this convertLinearToGamma]( [param:Float gammaFactor] ) </h3>
|
|
|
<p>
|
|
|
[page:Float gammaFactor] - (optional). Default is *2.0*.<br /><br />
|
|
|
Converts this color from linear space to gamma space by taking [page:.r r], [page:.g g] and [page:.b b] to the power of 1 / [page:Float gammaFactor].
|
|
|
</p>
|
|
|
|
|
|
- <h3>[method:Color convertLinearToSRGB]() </h3>
|
|
|
+ <h3>[method:this convertLinearToSRGB]() </h3>
|
|
|
<p>
|
|
|
Converts this color from linear space to sRGB space.
|
|
|
</p>
|
|
|
|
|
|
- <h3>[method:Color convertSRGBToLinear]() </h3>
|
|
|
+ <h3>[method:this convertSRGBToLinear]() </h3>
|
|
|
<p>
|
|
|
Converts this color from sRGB space to linear space.
|
|
|
</p>
|
|
|
|
|
|
- <h3>[method:Color copyGammaToLinear]( [param:Color color], [param:Float gammaFactor] ) </h3>
|
|
|
+ <h3>[method:this copyGammaToLinear]( [param:Color color], [param:Float gammaFactor] ) </h3>
|
|
|
<p>
|
|
|
[page:Color color] — Color to copy.<br />
|
|
|
[page:Float gammaFactor] - (optional). Default is *2.0*.<br /><br />
|
|
@@ -144,7 +144,7 @@ const color7 = new THREE.Color( 1, 0, 0 );
|
|
|
by taking [page:.r r], [page:.g g] and [page:.b b] to the power of [page:Float gammaFactor].
|
|
|
</p>
|
|
|
|
|
|
- <h3>[method:Color copyLinearToGamma]( [param:Color color], [param:Float gammaFactor] ) </h3>
|
|
|
+ <h3>[method:this copyLinearToGamma]( [param:Color color], [param:Float gammaFactor] ) </h3>
|
|
|
<p>
|
|
|
[page:Color color] — Color to copy.<br />
|
|
|
[page:Float gammaFactor] - (optional). Default is *2.0*.<br /><br />
|
|
@@ -153,14 +153,14 @@ const color7 = new THREE.Color( 1, 0, 0 );
|
|
|
by taking [page:.r r], [page:.g g] and [page:.b b] to the power of 1 / [page:Float gammaFactor].
|
|
|
</p>
|
|
|
|
|
|
- <h3>[method:Color copyLinearToSRGB]( [param:Color color]] ) </h3>
|
|
|
+ <h3>[method:this copyLinearToSRGB]( [param:Color color]] ) </h3>
|
|
|
<p>
|
|
|
[page:Color color] — Color to copy.<br />
|
|
|
|
|
|
Copies the given color into this color, and then converts this color from linear space to sRGB space.
|
|
|
</p>
|
|
|
|
|
|
- <h3>[method:Color copySRGBToLinear]( [param:Color color] ) </h3>
|
|
|
+ <h3>[method:this copySRGBToLinear]( [param:Color color] ) </h3>
|
|
|
<p>
|
|
|
[page:Color color] — Color to copy.<br />
|
|
|
|
|
@@ -170,7 +170,7 @@ const color7 = new THREE.Color( 1, 0, 0 );
|
|
|
<h3>[method:Boolean equals]( [param:Color color] ) </h3>
|
|
|
<p>Compares the RGB values of [page:Color color] with those of this object. Returns true if they are the same, false otherwise.</p>
|
|
|
|
|
|
- <h3>[method:Color fromArray]( [param:Array array], [param:Integer offset] ) </h3>
|
|
|
+ <h3>[method:this fromArray]( [param:Array array], [param:Integer offset] ) </h3>
|
|
|
<p>
|
|
|
[page:Array array] - [page:Array] of floats in the form [ [page:Float r], [page:Float g], [page:Float b] ].<br />
|
|
|
[page:Integer offset] - An optional offset into the array.<br /><br />
|
|
@@ -208,7 +208,7 @@ const color7 = new THREE.Color( 1, 0, 0 );
|
|
|
<h3>[method:String getStyle]()</h3>
|
|
|
<p>Returns the value of this color as a CSS style string. Example: 'rgb(255,0,0)'.</p>
|
|
|
|
|
|
- <h3>[method:Color lerp]( [param:Color color], [param:Float alpha] ) </h3>
|
|
|
+ <h3>[method:this lerp]( [param:Color color], [param:Float alpha] ) </h3>
|
|
|
<p>
|
|
|
[page:Color color] - color to converge on.<br />
|
|
|
[page:Float alpha] - interpolation factor in the closed interval [0, 1].<br /><br />
|
|
@@ -229,7 +229,7 @@ const color7 = new THREE.Color( 1, 0, 0 );
|
|
|
- alpha = 0 will be [page:Color color1], and alpha = 1 will be [page:Color color2].
|
|
|
</p>
|
|
|
|
|
|
- <h3>[method:Color lerpHSL]( [param:Color color], [param:Float alpha] ) </h3>
|
|
|
+ <h3>[method:this lerpHSL]( [param:Color color], [param:Float alpha] ) </h3>
|
|
|
<p>
|
|
|
[page:Color color] - color to converge on.<br />
|
|
|
[page:Float alpha] - interpolation factor in the closed interval [0, 1].<br /><br />
|
|
@@ -241,20 +241,20 @@ const color7 = new THREE.Color( 1, 0, 0 );
|
|
|
this color and 1.0 is the first argument.
|
|
|
</p>
|
|
|
|
|
|
- <h3>[method:Color multiply]( [param:Color color] ) </h3>
|
|
|
+ <h3>[method:this multiply]( [param:Color color] ) </h3>
|
|
|
<p>Multiplies this color's RGB values by the given [page:Color color]'s RGB values.</p>
|
|
|
|
|
|
- <h3>[method:Color multiplyScalar]( [param:Number s] ) </h3>
|
|
|
+ <h3>[method:this multiplyScalar]( [param:Number s] ) </h3>
|
|
|
<p>Multiplies this color's RGB values by [page:Number s].</p>
|
|
|
|
|
|
- <h3>[method:Color offsetHSL]( [param:Float h], [param:Float s], [param:Float l] ) </h3>
|
|
|
+ <h3>[method:this offsetHSL]( [param:Float h], [param:Float s], [param:Float l] ) </h3>
|
|
|
<p>
|
|
|
Adds the given [page:Float h], [page:Float s], and [page:Float l] to this color's values.
|
|
|
Internally, this converts the color's [page:.r r], [page:.g g] and [page:.b b] values to HSL, adds
|
|
|
[page:Float h], [page:Float s], and [page:Float l], and then converts the color back to RGB.
|
|
|
</p>
|
|
|
|
|
|
- <h3>[method:Color set]( [param:Color_Hex_or_String value] ) </h3>
|
|
|
+ <h3>[method:this set]( [param:Color_Hex_or_String value] ) </h3>
|
|
|
<p>
|
|
|
[page:Color_Hex_or_String value] - Value to set this color to.<br /><br />
|
|
|
|
|
@@ -262,14 +262,14 @@ const color7 = new THREE.Color( 1, 0, 0 );
|
|
|
Delegates to [page:.copy], [page:.setStyle], or [page:.setHex] depending on input type.
|
|
|
</p>
|
|
|
|
|
|
- <h3>[method:Color setHex]( [param:Integer hex] ) </h3>
|
|
|
+ <h3>[method:this setHex]( [param:Integer hex] ) </h3>
|
|
|
<p>
|
|
|
[page:Integer hex] — [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet hexadecimal triplet] format.<br /><br />
|
|
|
|
|
|
Sets this color from a hexadecimal value.
|
|
|
</p>
|
|
|
|
|
|
- <h3>[method:Color setHSL]( [param:Float h], [param:Float s], [param:Float l] ) </h3>
|
|
|
+ <h3>[method:this setHSL]( [param:Float h], [param:Float s], [param:Float l] ) </h3>
|
|
|
<p>
|
|
|
[page:Float h] — hue value between 0.0 and 1.0 <br />
|
|
|
[page:Float s] — saturation value between 0.0 and 1.0 <br />
|
|
@@ -278,7 +278,7 @@ const color7 = new THREE.Color( 1, 0, 0 );
|
|
|
Sets color from HSL values.
|
|
|
</p>
|
|
|
|
|
|
- <h3>[method:Color setRGB]( [param:Float r], [param:Float g], [param:Float b] ) </h3>
|
|
|
+ <h3>[method:this setRGB]( [param:Float r], [param:Float g], [param:Float b] ) </h3>
|
|
|
<p>
|
|
|
[page:Float r] — Red channel value between 0.0 and 1.0.<br />
|
|
|
[page:Float g] — Green channel value between 0.0 and 1.0.<br />
|
|
@@ -287,14 +287,14 @@ const color7 = new THREE.Color( 1, 0, 0 );
|
|
|
Sets this color from RGB values.
|
|
|
</p>
|
|
|
|
|
|
- <h3>[method:Color setScalar]( [param:Float scalar] ) </h3>
|
|
|
+ <h3>[method:this setScalar]( [param:Float scalar] ) </h3>
|
|
|
<p>
|
|
|
[page:Float scalar] — a value between 0.0 and 1.0.<br /><br />
|
|
|
|
|
|
Sets all three color components to the value [page:Float scalar].
|
|
|
</p>
|
|
|
|
|
|
- <h3>[method:Color setStyle]( [param:String style] ) </h3>
|
|
|
+ <h3>[method:this setStyle]( [param:String style] ) </h3>
|
|
|
<p>
|
|
|
[page:String style] — color as a CSS-style string.<br /><br />
|
|
|
|
|
@@ -313,7 +313,7 @@ const color7 = new THREE.Color( 1, 0, 0 );
|
|
|
Note that for X11 color names, multiple words such as Dark Orange become the string 'darkorange'.
|
|
|
</p>
|
|
|
|
|
|
- <h3>[method:Color setColorName]( [param:String style] ) </h3>
|
|
|
+ <h3>[method:this setColorName]( [param:String style] ) </h3>
|
|
|
<p>
|
|
|
[page:String style] — color name ( from [link:https://en.wikipedia.org/wiki/X11_color_names#Color_name_chart X11 color names] ).<br /><br />
|
|
|
|
|
@@ -322,7 +322,7 @@ const color7 = new THREE.Color( 1, 0, 0 );
|
|
|
For convenience, the list of names is exposed in Color.NAMES as a hash: <code>Color.NAMES.aliceblue // returns 0xF0F8FF</code>
|
|
|
</p>
|
|
|
|
|
|
- <h3>[method:Color sub]( [param:Color color] ) </h3>
|
|
|
+ <h3>[method:this sub]( [param:Color color] ) </h3>
|
|
|
<p>
|
|
|
Subtracts the RGB components of the given color from the RGB components of this color.
|
|
|
If this results in a negative component, that component is set to zero.
|