Skip to content

Commit 315b873

Browse files
author
cjshannon
committed
Update Color.html
updated documentation for constructor argument added documentation for undocumented methods: add, addColor, addScalar, multiply, multiplyScalar, equals, lerp, getStyle, setStyle, setHSL, offsetHSL, getHSL. removed documentation for methods that don't exist: getContextStyle, setContextStyle Removed reference to ColorUtils, which no longer exists.
1 parent b3e3cd7 commit 315b873

1 file changed

Lines changed: 67 additions & 12 deletions

File tree

docs/api/math/Color.html

Lines changed: 67 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,21 @@
1010
<h1>[name]</h1>
1111

1212
<div class="desc">
13-
Represents a color. See also [page:ColorUtils].
13+
Represents a color.
1414
</div>
1515

1616

1717
<h2>Example</h2>
18-
18+
<code>var color = new THREE.Color();</code>
1919
<code>var color = new THREE.Color( 0xff0000 );</code>
20+
<code>var color = new THREE.Color("rgb(255,0,0)");</code>
2021

2122

2223
<h2>Constructor</h2>
2324

24-
<h3>[name]( [page:Integer hex])</h3>
25+
<h3>[name]( value )</h3>
2526
<div>
26-
hex — initial color in hexadecimal<br />
27+
valueoptional argument that sets initial color. Can be a hexadecimal or a CSS-style string, for example, "rgb(250, 0,0)", "rgb(100%,0%,0%)", "#ff0000", "#f00", or "red"
2728
</div>
2829

2930
<h2>Properties</h2>
@@ -106,21 +107,75 @@ <h3>.setHex( [page:Integer hex] ) [page:this]</h3>
106107
<div>
107108
Sets this color from a hexadecimal value.
108109
</div>
109-
110-
<h3>.getContextStyle() [page:String]</h3>
110+
111+
<h3>.setStyle( [page:String style] ) [page:this]</h3>
111112
<div>
112-
Returns the value of this color in CSS context style.<br />
113-
Example: rgb(r, g, b)
113+
style — color as a CSS-style string, for example, "rgb(250, 0,0)", "rgb(100%,0%,0%)", "#ff0000", "#f00", or "red"
114114
</div>
115-
116-
<h3>.setContextStyle( [page:String contextStyle] ) [page:this]</h3>
117115
<div>
118-
contextStyle — Color in CSS context style format.<br />
116+
Sets this color from a CSS-style string.
117+
</div>
118+
119+
<h3>.getStyle() [page:String]</h3>
120+
<div>
121+
Returns the value of this color as a CSS-style string. Example: rgb(255,0,0)
122+
</div>
123+
124+
<h3>.setHSL( [page:Float h], [page:Float s], [page:Float l] ) [page:this]</h3>
125+
<div>
126+
h — hue value between 0.0 and 1.0
127+
s — saturation value between 0.0 and 1.0
128+
l — lightness value between 0.0 and 1.0
129+
</div>
130+
<div>
131+
Sets color from hsl
132+
</div>
133+
134+
<h3>.getHSL() [page:Object hsl]</h3>
135+
<div>
136+
Returns an object with properties h, s, and l.
137+
</div>
138+
139+
<h3>.offsetHSL( [page:Float h], [page:Float s], [page:Float l] ) [page:this]</h3>
140+
<div>
141+
Adds given h, s, and l to this color's existing h, s, and l values.
119142
</div>
143+
144+
<h3>.add ( [page:Color color] ) [page:this]</h3>
120145
<div>
121-
Sets this color from a CSS context style string.
146+
Adds rgb values of given color to rgb values of this color
147+
</div>
148+
149+
<h3>.addColors( [page:Color color1], [page:Color color2] ) [page:this]</h3>
150+
<div>
151+
Sets this color to the sum of color1 and color2
152+
</div>
153+
154+
<h3>.addScalar( [page:Number s] ) [page:this]</h3>
155+
<div>
156+
Adds s to the rgb values of this color
157+
</div>
158+
159+
<h3>.multiply( [page:Color color] ) [page:this]</h3>
160+
<div>
161+
Multiplies this color's rgb values by given color's rgb values
122162
</div>
123163

164+
<h3>.multiplyScalar( [page:Number s] ) [page:this]</h3>
165+
<div>
166+
Multiplies this color's rgb values by s
167+
</div>
168+
169+
<h3>.lerp( [page:Color color], alpha ) [page:this]</h3>
170+
<div>
171+
todo
172+
</div>
173+
174+
<h3>.equals( [page:Color c] ) [page:this]</h3>
175+
<div>
176+
Compares this color and c and returns true if they are the same, false otherwise.
177+
</div>
178+
124179
<h3>.clone() [page:Color]</h3>
125180
<div>
126181
Clones this color.

0 commit comments

Comments
 (0)