Selaa lähdekoodia

Documentation: Improved Color.

Mr.doob 13 vuotta sitten
vanhempi
commit
c5b29f93fc
2 muutettua tiedostoa jossa 9 lisäystä ja 159 poistoa
  1. 9 15
      docs/api/core/Color.html
  2. 0 144
      docs/api/core/Color.rst

+ 9 - 15
docs/api/core/Color.html

@@ -16,17 +16,17 @@ hex — initial color in hexadecimal<br />
 
 <h3>.[page:Number r]</h3>
 <div>
-Red channel value (between 0 and 1).
+Red channel value between 0 and 1. Default is 1.
 </div>
 
 <h3>.[page:Number g]</h3>
 <div>
-Green channel value (between 0 and 1).
+Green channel value between 0 and 1. Default is 1.
 </div>
 
 <h3>.[page:Number b]</h3>
 <div>
-Blue channel value (between 0 and 1).
+Blue channel value between 0 and 1. Default is 1.
 </div>
 
 <h2>Methods</h2>
@@ -57,25 +57,19 @@ Copies given color making conversion from linear to gamma space.
 
 <h3>.convertGammaToLinear() [page:this]</h3>
 <div>
-color — Color to copy.
-</div>
-<div>
 Converts this color from gamma to linear space.
 </div>
 
 <h3>.convertLinearToGamma() [page:this]</h3>
 <div>
-color — Color to copy.
-</div>
-<div>
 Converts this color from linear to gamma space.
 </div>
 
 <h3>.setRGB( [page:Number r], [page:Number g], [page:Number b] ) [page:this]</h3>
 <div>
-r — Red channel value (between 0 and 1).<br />
-g — Green channel value (between 0 and 1).<br />
-b — Blue channel value (between 0 and 1).
+r — Red channel value between 0 and 1.<br />
+g — Green channel value between 0 and 1.<br />
+b — Blue channel value between 0 and 1.
 </div>
 <div>
 Sets this color from RGB values.
@@ -83,9 +77,9 @@ Sets this color from RGB values.
 
 <h3>.setHSV( [page:Number h], [page:Number s], [page:Number v] ) [page:this]</h3>
 <div>
-h — Hue channel (between 0 and 1).<br />
-s — Saturation channel (between 0 and 1).<br />
-v — Value channel (between 0 and 1).
+h — Hue channel value between 0 and 1.<br />
+s — Saturation value channel between 0 and 1.<br />
+v — Value channel value between 0 and 1.
 </div>
 <div>
 Sets this color from HSV values.<br />

+ 0 - 144
docs/api/core/Color.rst

@@ -1,144 +0,0 @@
-Color - Represents a color
---------------------------
-
-.. ...............................................................................
-.. rubric:: Constructor
-.. ...............................................................................
-
-.. class:: Color(hex)
-
-    Represents a color
-
-    See also :class:`ColorUtils`
-
-    :param integer hex: Hex value to intialize the color
-
-
-.. ...............................................................................
-.. rubric:: Attributes
-.. ...............................................................................
-
-.. attribute:: Color.r
-
-    Red channel (float between 0 and 1) (default ``1``)
-
-.. attribute:: Color.g
-
-    Green channel (float between 0 and 1) (default ``1``)
-
-.. attribute:: Color.b
-
-    Blue channel (float between 0 and 1) (default ``1``)
-
-
-.. ...............................................................................
-.. rubric:: Methods
-.. ...............................................................................
-
-.. function:: Color.clone()
-
-    Clones this color
-
-    :returns: New instance identical to this color
-    :rtype: :class:`Color`
-
-.. function:: Color.copy( color )
-
-    Copies given ``color`` into this color
-
-    :param Color color: Color to copy
-    :returns: This color
-    :rtype: :class:`Color`
-
-.. function:: Color.copyGammaToLinear( color )
-
-    Copies given ``color`` into this color, making conversion from gamma to linear color space
-
-    :param Color color: Color to copy
-    :returns: This color
-    :rtype: :class:`Color`
-
-.. function:: Color.copyLinearToGamma(color)
-
-    Copies given ``color`` into this color, making conversion from linear to gamma color space
-
-    :param Color color: Color to copy
-    :returns: This color
-    :rtype: :class:`Color`
-
-.. function:: Color.convertGammaToLinear()
-
-    Converts this color from gamma to linear color space
-
-    :returns: This color
-    :rtype: :class:`Color`
-
-.. function:: Color.convertLinearToGamma()
-
-    Converts this color from linear to gamma color space
-
-    :returns: This color
-    :rtype: :class:`Color`
-
-.. function:: Color.setRGB( r, g, b )
-
-    Sets this color from RGB values
-
-    :param float r: Red channel value (between 0 and 1)
-    :param float g: Green channel value (between 0 and 1)
-    :param float b: Blue channel value (between 0 and 1)
-    :returns: This color
-    :rtype: :class:`Color`
-
-.. function:: Color.setHSV( h, s, v )
-
-    Sets this color from HSV values.
-
-    Based on MochiKit implementation by Bob Ippolito.
-
-    :param float h: Hue channel (between 0 and 1)
-    :param float s: Saturation channel (between 0 and 1)
-    :param float v: Value channel (between 0 and 1)
-    :returns: This color
-    :rtype: :class:`Color`
-
-.. function:: Color.setHex( hex )
-
-    Sets this color from a hex value
-
-    :param integer hex: Value of the color in hex (between ``0x000000`` and ``0xffffff``)
-    :returns: This color
-    :rtype: :class:`Color`
-
-.. function:: Color.getHex()
-
-    Gets the value of this color in hex
-
-    :returns: Color value in hex
-    :rtype: integer
-
-.. function:: Color.getContextStyle()
-
-    Returns the value of this color in CSS context style.
-
-    Example: ``rgb( r, g, b )``
-
-    :returns: CSS-formatted color value
-    :rtype: string
-
-
-.. ...............................................................................
-.. rubric:: Example
-.. ...............................................................................
-
-::
-
-    var colors = [];
-
-    for ( i = 0; i < 5000; i ++ ) {
-
-        x = 2000 * Math.random() - 1000;
-        colors[ i ] = new THREE.Color( 0xffffff );
-        colors[ i ].setHSV( ( x + 1000 ) / 2000, 1.0, 1.0 );
-
-    }