ColorConverter.html 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>ColorConverter - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <h1 translate="no">ColorConverter</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>A utility class with helper functions for color conversion.</p></div>
  16. </header>
  17. <article>
  18. <h2 class="subsection-title">Import</h2>
  19. <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>
  20. <pre><code class="language-js">import { ColorConverter } from 'three/addons/math/ColorConverter.js';</code></pre>
  21. <div class="container-overview">
  22. <div class="method">
  23. </div>
  24. </div>
  25. <h2 class="subsection-title">Static Methods</h2>
  26. <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>
  27. <div class="method">
  28. <div class="description">
  29. <p>Returns a HSV color representation of the given color object.</p>
  30. </div>
  31. <table class="params">
  32. <tbody>
  33. <tr>
  34. <td class="name"><code>color</code></td>
  35. <td class="description last"><p>The color to get HSV values from.</p></td>
  36. </tr>
  37. <tr>
  38. <td class="name"><code>target</code></td>
  39. <td class="description last"><p>The target object that is used to store the method's result.</p></td>
  40. </tr>
  41. </tbody>
  42. </table>
  43. <dl class="details">
  44. <dt class="tag-returns"><strong>Returns:</strong> The HSV color.</dt>
  45. </dl>
  46. </div>
  47. <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>
  48. <div class="method">
  49. <div class="description">
  50. <p>Sets the given HSV color definition to the given color object.</p>
  51. </div>
  52. <table class="params">
  53. <tbody>
  54. <tr>
  55. <td class="name"><code>color</code></td>
  56. <td class="description last"><p>The color to set.</p></td>
  57. </tr>
  58. <tr>
  59. <td class="name"><code>h</code></td>
  60. <td class="description last"><p>The hue.</p></td>
  61. </tr>
  62. <tr>
  63. <td class="name"><code>s</code></td>
  64. <td class="description last"><p>The saturation.</p></td>
  65. </tr>
  66. <tr>
  67. <td class="name"><code>v</code></td>
  68. <td class="description last"><p>The value.</p></td>
  69. </tr>
  70. </tbody>
  71. </table>
  72. <dl class="details">
  73. <dt class="tag-returns"><strong>Returns:</strong> The update color.</dt>
  74. </dl>
  75. </div>
  76. <h2 class="subsection-title">Source</h2>
  77. <p>
  78. <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>
  79. </p>
  80. </article>
  81. </section>
  82. <script src="../scripts/linenumber.js"></script>
  83. <script src="../scripts/page.js"></script>
  84. </body>
  85. </html>
粤ICP备19079148号