123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <script src="../../list.js"></script>
- <script src="../../page.js"></script>
- <link type="text/css" rel="stylesheet" href="../../page.css" />
- </head>
- <body>
- <h1>[name]</h1>
- <div class="desc">
- Represents a color. See also [page:ColorUtils].
- </div>
- <h2>Example</h2>
- <code>var color = new THREE.Color( 0xff0000 );</code>
- <h2>Constructor</h2>
- <h3>[name]( [page:Integer hex])</h3>
- <div>
- hex — initial color in hexadecimal<br />
- </div>
- <h2>Properties</h2>
- <h3>.[page:Float r]</h3>
- <div>
- Red channel value between 0 and 1. Default is 1.
- </div>
- <h3>.[page:Float g]</h3>
- <div>
- Green channel value between 0 and 1. Default is 1.
- </div>
- <h3>.[page:Float b]</h3>
- <div>
- Blue channel value between 0 and 1. Default is 1.
- </div>
- <h2>Methods</h2>
- <h3>.copy( [page:Color color] ) [page:this]</h3>
- <div>
- color — Color to copy.
- </div>
- <div>
- Copies given color.
- </div>
- <h3>.copyGammaToLinear( [page:Color color] ) [page:this]</h3>
- <div>
- color — Color to copy.
- </div>
- <div>
- Copies given color making conversion from gamma to linear space.
- </div>
- <h3>.copyLinearToGamma( [page:Color color] ) [page:this]</h3>
- <div>
- color — Color to copy.
- </div>
- <div>
- Copies given color making conversion from linear to gamma space.
- </div>
- <h3>.convertGammaToLinear() [page:this]</h3>
- <div>
- Converts this color from gamma to linear space.
- </div>
- <h3>.convertLinearToGamma() [page:this]</h3>
- <div>
- Converts this color from linear to gamma space.
- </div>
- <h3>.setRGB( [page:Float r], [page:Float g], [page:Float 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.
- </div>
- <div>
- Sets this color from RGB values.
- </div>
- <h3>.getHex() [page:Integer]</h3>
- <div>
- Returns the hexadecimal value of this color.
- </div>
- <h3>.getHexString() [page:String]</h3>
- <div>
- Returns the string formated hexadecimal value of this color.
- </div>
- <h3>.setHex( [page:Integer hex] ) [page:this]</h3>
- <div>
- hex — Color in hexadecimal.<br />
- </div>
- <div>
- Sets this color from a hexadecimal value.
- </div>
- <h3>.getContextStyle() [page:String]</h3>
- <div>
- Returns the value of this color in CSS context style.<br />
- Example: rgb(r, g, b)
- </div>
- <h3>.setContextStyle( [page:String contextStyle] ) [page:this]</h3>
- <div>
- contextStyle — Color in CSS context style format.<br />
- </div>
- <div>
- Sets this color from a CSS context style string.
- </div>
- <h3>.clone() [page:Color]</h3>
- <div>
- Clones this color.
- </div>
- <h2>Source</h2>
- [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
- </body>
- </html>
|