浏览代码

Docs: add Color.setStyleName and Color.NAMES

@pauloddr 7 年之前
父节点
当前提交
d58559dc7f
共有 1 个文件被更改,包括 10 次插入1 次删除
  1. 10 1
      docs/api/en/math/Color.html

+ 10 - 1
docs/api/en/math/Color.html

@@ -126,7 +126,7 @@ var color = new THREE.Color( 1, 0, 0 );
 		[page:Float gammaFactor] - (optional). Default is *2.0*.<br /><br />
 		[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].
 		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>
 		</p>
-		
+
 		<h3>[method:Color convertLinearToGamma]( [param:Float gammaFactor] ) </h3>
 		<h3>[method:Color convertLinearToGamma]( [param:Float gammaFactor] ) </h3>
 		<p>
 		<p>
 		[page:Float gammaFactor] - (optional). Default is *2.0*.<br /><br />
 		[page:Float gammaFactor] - (optional). Default is *2.0*.<br /><br />
@@ -302,6 +302,15 @@ var color = new THREE.Color( 1, 0, 0 );
 		Note that for X11 color names, multiple words such as Dark Orange become the string 'darkorange' (all lowercase).
 		Note that for X11 color names, multiple words such as Dark Orange become the string 'darkorange' (all lowercase).
 		</p>
 		</p>
 
 
+		<h3>[method:Color setStyleName]( [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 />
+
+		Sets this color from a color name. Faster than [page:.setStyle] method if you don't need the other CSS-style formats.<br/><br/>
+
+		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:Color sub]( [param:Color color] ) </h3>
 		<p>
 		<p>
 		Subtracts the RGB components of the given color from the RGB components of this color.
 		Subtracts the RGB components of the given color from the RGB components of this color.