|
1 | 1 | <h1>[name]</h1>
|
2 | 2 |
|
3 |
| -<div class="desc">todo</div> |
| 3 | +<div class="desc"> |
| 4 | +Represents a color. See also [page:ColorUtils]. |
| 5 | +</div> |
4 | 6 |
|
5 | 7 |
|
6 | 8 | <h2>Constructor</h2>
|
7 | 9 |
|
8 |
| -<h3>[name]()</h3> |
9 |
| - |
| 10 | +<h3>[name]( [page:Number hex])</h3> |
| 11 | +<div> |
| 12 | +hex — initial color in hexadecimal<br /> |
| 13 | +</div> |
10 | 14 |
|
11 | 15 | <h2>Properties</h2>
|
12 | 16 |
|
13 |
| -<h3>.[page:Vector3 todo]</h3> |
| 17 | +<h3>.[page:Number r]</h3> |
| 18 | +<div> |
| 19 | +Red channel value (between 0 and 1). |
| 20 | +</div> |
| 21 | + |
| 22 | +<h3>.[page:Number g]</h3> |
| 23 | +<div> |
| 24 | +Green channel value (between 0 and 1). |
| 25 | +</div> |
14 | 26 |
|
| 27 | +<h3>.[page:Number b]</h3> |
| 28 | +<div> |
| 29 | +Blue channel value (between 0 and 1). |
| 30 | +</div> |
15 | 31 |
|
16 | 32 | <h2>Methods</h2>
|
17 | 33 |
|
18 |
| -<h3>.todo( [page:Vector3 todo] )</h3> |
| 34 | +<h3>.copy( [page:Color color] ) [page:this]</h3> |
| 35 | +<div> |
| 36 | +color — Color to copy. |
| 37 | +</div> |
| 38 | +<div> |
| 39 | +Copies given color. |
| 40 | +</div> |
| 41 | + |
| 42 | +<h3>.copyGammaToLinear( [page:Color color] ) [page:this]</h3> |
| 43 | +<div> |
| 44 | +color — Color to copy. |
| 45 | +</div> |
| 46 | +<div> |
| 47 | +Copies given color making conversion from gamma to linear space. |
| 48 | +</div> |
| 49 | + |
| 50 | +<h3>.copyLinearToGamma( [page:Color color] ) [page:this]</h3> |
| 51 | +<div> |
| 52 | +color — Color to copy. |
| 53 | +</div> |
| 54 | +<div> |
| 55 | +Copies given color making conversion from linear to gamma space. |
| 56 | +</div> |
| 57 | + |
| 58 | +<h3>.convertGammaToLinear() [page:this]</h3> |
| 59 | +<div> |
| 60 | +color — Color to copy. |
| 61 | +</div> |
| 62 | +<div> |
| 63 | +Converts this color from gamma to linear space. |
| 64 | +</div> |
| 65 | + |
| 66 | +<h3>.convertLinearToGamma() [page:this]</h3> |
| 67 | +<div> |
| 68 | +color — Color to copy. |
| 69 | +</div> |
| 70 | +<div> |
| 71 | +Converts this color from linear to gamma space. |
| 72 | +</div> |
| 73 | + |
| 74 | +<h3>.setRGB( [page:Number r], [page:Number g], [page:Number b] ) [page:this]</h3> |
| 75 | +<div> |
| 76 | +r — Red channel value (between 0 and 1).<br /> |
| 77 | +g — Green channel value (between 0 and 1).<br /> |
| 78 | +b — Blue channel value (between 0 and 1). |
| 79 | +</div> |
| 80 | +<div> |
| 81 | +Sets this color from RGB values. |
| 82 | +</div> |
| 83 | + |
| 84 | +<h3>.setHSV( [page:Number h], [page:Number s], [page:Number v] ) [page:this]</h3> |
| 85 | +<div> |
| 86 | +h — Hue channel (between 0 and 1).<br /> |
| 87 | +s — Saturation channel (between 0 and 1).<br /> |
| 88 | +v — Value channel (between 0 and 1). |
| 89 | +</div> |
| 90 | +<div> |
| 91 | +Sets this color from HSV values.<br /> |
| 92 | +Based on MochiKit implementation by Bob Ippolito. |
| 93 | +</div> |
| 94 | + |
| 95 | +<h3>.setHex( [page:Number hex] ) [page:this]</h3> |
| 96 | +<div> |
| 97 | +hex — Color in hexadecimal.<br /> |
| 98 | +</div> |
| 99 | +<div> |
| 100 | +Sets this color from a hexadecimal value. |
| 101 | +</div> |
| 102 | + |
| 103 | +<h3>.getHex() [page:Number]</h3> |
19 | 104 | <div>
|
20 |
| -todo — todo<br /> |
| 105 | +Returns the value of this color in hexadecimal. |
21 | 106 | </div>
|
22 | 107 |
|
| 108 | +<h3>.getContextStyle() [page:String]</h3> |
| 109 | +<div> |
| 110 | +Returns the value of this color in CSS context style.<br /> |
| 111 | +Example: rgb(r, g, b) |
| 112 | +</div> |
| 113 | + |
| 114 | +<h3>.clone() [page:Color]</h3> |
| 115 | +<div> |
| 116 | +Clones this object. |
| 117 | +</div> |
23 | 118 |
|
24 | 119 | <h2>Source</h2>
|
25 | 120 |
|
|
0 commit comments