| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>ColorConverter - Three.js Docs</title>
- <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
- <script src="../scripts/highlight.min.js"></script>
- <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
- <link type="text/css" rel="stylesheet" href="../styles/page.css">
- </head>
- <body>
- <h1 translate="no">ColorConverter</h1>
- <section>
- <header>
- <div class="class-description"><p>A utility class with helper functions for color conversion.</p></div>
- </header>
- <article>
- <h2 class="subsection-title">Import</h2>
- <p><span translate="no">ColorConverter</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank">Installation#Addons</a>.</p>
- <pre><code class="language-js">import { ColorConverter } from 'three/addons/math/ColorConverter.js';</code></pre>
- <div class="container-overview">
- <div class="method">
- </div>
- </div>
- <h2 class="subsection-title">Static Methods</h2>
- <h3 class="name name-method" id=".getHSV" translate="no">.<a href="#.getHSV">getHSV</a><span class="signature">( color : <span class="param-type">Color</span>, target : <span class="param-type">Object</span> )</span><span class="type-signature"> : Object</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns a HSV color representation of the given color object.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name"><code>color</code></td>
- <td class="description last"><p>The color to get HSV values from.</p></td>
- </tr>
- <tr>
- <td class="name"><code>target</code></td>
- <td class="description last"><p>The target object that is used to store the method's result.</p></td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The HSV color.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id=".setHSV" translate="no">.<a href="#.setHSV">setHSV</a><span class="signature">( color : <span class="param-type">Color</span>, h : <span class="param-type">number</span>, s : <span class="param-type">number</span>, v : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Color.html">Color</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets the given HSV color definition to the given color object.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name"><code>color</code></td>
- <td class="description last"><p>The color to set.</p></td>
- </tr>
- <tr>
- <td class="name"><code>h</code></td>
- <td class="description last"><p>The hue.</p></td>
- </tr>
- <tr>
- <td class="name"><code>s</code></td>
- <td class="description last"><p>The saturation.</p></td>
- </tr>
- <tr>
- <td class="name"><code>v</code></td>
- <td class="description last"><p>The value.</p></td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The update color.</dt>
- </dl>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/math/ColorConverter.js" target="_blank" rel="noopener" translate="no">examples/jsm/math/ColorConverter.js</a>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|