Web UI for ARGUS server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

272 lines
5.8 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>GradientStop</title>
  6. <base target="class-frame">
  7. <link href="../assets/css/docs.css" rel="stylesheet" type="text/css">
  8. <script src="../assets/js/paper.js"></script>
  9. <script src="../assets/js/jquery.js"></script>
  10. <script src="../assets/js/codemirror.js"></script>
  11. <script src="../assets/js/docs.js"></script>
  12. </head>
  13. <body>
  14. <article class="reference">
  15. <div class="reference-class">
  16. <h1>GradientStop</h1>
  17. <p>The GradientStop object.</p>
  18. </div>
  19. <!-- =============================== constructors ========================== -->
  20. <div class="reference-members">
  21. <h2>Constructors</h2>
  22. <div id="gradientstop" class="member">
  23. <div class="member-link">
  24. <a name="gradientstop" href="#gradientstop"><tt><b>GradientStop</b>([color[, offset]])</tt></a>
  25. </div>
  26. <div class="member-description hidden">
  27. <div class="member-text">
  28. <p>Creates a GradientStop object.</p>
  29. <ul class="member-list">
  30. <h4>Parameters:</h4>
  31. <li>
  32. <tt>color:</tt>
  33. <a href="../classes/Color.html"><tt>Color</tt></a>
  34. &mdash;&nbsp;the color of the stop
  35. &mdash;&nbsp;optional, default: <tt>new Color(0, 0, 0)</tt>
  36. </li>
  37. <li>
  38. <tt>offset:</tt>
  39. <tt>Number</tt>
  40. &mdash;&nbsp;the position of the stop on the gradient ramp as a value between <code>0</code> and <code>1</code>; <code>null</code> or <code>undefined</code> for automatic assignment.
  41. &mdash;&nbsp;optional, default: <tt>null</tt>
  42. </li>
  43. </ul>
  44. <ul class="member-list">
  45. <h4>Returns:</h4>
  46. <li>
  47. <tt><a href="../classes/GradientStop.html"><tt>GradientStop</tt></a></tt>
  48. </li>
  49. </ul>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. <!-- ================================ properties =========================== -->
  55. <div class="reference-members">
  56. <h2>Properties</h2>
  57. <div id="offset" class="member">
  58. <div class="member-link">
  59. <a name="offset" href="#offset"><tt><b>offset</b></tt></a>
  60. </div>
  61. <div class="member-description hidden">
  62. <div class="member-text">
  63. <p>The ramp-point of the gradient stop as a value between <code>0</code> and <code>1</code>.</p>
  64. <ul class="member-list">
  65. <h4>Type:</h4>
  66. <li>
  67. <tt>Number</tt>
  68. </li>
  69. </ul>
  70. <h4>Example:<span class="description">Animating a gradient's ramp points:</span></h4>
  71. <div class="paperscript split">
  72. <div class="buttons">
  73. <div class="button run">Run</div>
  74. </div>
  75. <script type="text/paperscript" canvas="canvas-0">
  76. // Create a circle shaped path at the center of the view,
  77. // using 40% of the height of the view as its radius
  78. // and fill it with a radial gradient color:
  79. var path = new Path.Circle({
  80. center: view.center,
  81. radius: view.bounds.height * 0.4
  82. });
  83. path.fillColor = {
  84. gradient: {
  85. stops: [['yellow', 0.05], ['red', 0.2], ['black', 1]],
  86. radial: true
  87. },
  88. origin: path.position,
  89. destination: path.bounds.rightCenter
  90. };
  91. var gradient = path.fillColor.gradient;
  92. // This function is called each frame of the animation:
  93. function onFrame(event) {
  94. var blackStop = gradient.stops[2];
  95. // Animate the offset between 0.7 and 0.9:
  96. blackStop.offset = Math.sin(event.time * 5) * 0.1 + 0.8;
  97. // Animate the offset between 0.2 and 0.4
  98. var redStop = gradient.stops[1];
  99. redStop.offset = Math.sin(event.time * 3) * 0.1 + 0.3;
  100. }
  101. </script>
  102. <div class="canvas"><canvas width="516" height="300" id="canvas-0"></canvas></div>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. <div id="color" class="member">
  108. <div class="member-link">
  109. <a name="color" href="#color"><tt><b>color</b></tt></a>
  110. </div>
  111. <div class="member-description hidden">
  112. <div class="member-text">
  113. <p>The color of the gradient stop.</p>
  114. <ul class="member-list">
  115. <h4>Type:</h4>
  116. <li>
  117. <a href="../classes/Color.html"><tt>Color</tt></a>
  118. </li>
  119. </ul>
  120. <h4>Example:<span class="description">Animating a gradient's ramp points:</span></h4>
  121. <div class="paperscript split">
  122. <div class="buttons">
  123. <div class="button run">Run</div>
  124. </div>
  125. <script type="text/paperscript" canvas="canvas-1">
  126. // Create a circle shaped path at the center of the view,
  127. // using 40% of the height of the view as its radius
  128. // and fill it with a radial gradient color:
  129. var path = new Path.Circle({
  130. center: view.center,
  131. radius: view.bounds.height * 0.4
  132. });
  133. path.fillColor = {
  134. gradient: {
  135. stops: [['yellow', 0.05], ['red', 0.2], ['black', 1]],
  136. radial: true
  137. },
  138. origin: path.position,
  139. destination: path.bounds.rightCenter
  140. };
  141. var redStop = path.fillColor.gradient.stops[1];
  142. var blackStop = path.fillColor.gradient.stops[2];
  143. // This function is called each frame of the animation:
  144. function onFrame(event) {
  145. // Animate the offset between 0.7 and 0.9:
  146. blackStop.offset = Math.sin(event.time * 5) * 0.1 + 0.8;
  147. // Animate the offset between 0.2 and 0.4
  148. redStop.offset = Math.sin(event.time * 3) * 0.1 + 0.3;
  149. }
  150. </script>
  151. <div class="canvas"><canvas width="516" height="300" id="canvas-1"></canvas></div>
  152. </div>
  153. </div>
  154. </div>
  155. </div>
  156. </div>
  157. <!-- ============================== methods ================================ -->
  158. <div class="reference-members">
  159. <h2>Methods</h2>
  160. <div id="clone" class="member">
  161. <div class="member-link">
  162. <a name="clone" href="#clone"><tt><b>clone</b>()</tt></a>
  163. </div>
  164. <div class="member-description hidden">
  165. <div class="member-text">
  166. <ul class="member-list">
  167. <h4>Returns:</h4>
  168. <li>
  169. <tt><a href="../classes/GradientStop.html"><tt>GradientStop</tt></a></tt>&nbsp;&mdash;&nbsp;a copy of the gradient-stop
  170. </li>
  171. </ul>
  172. </div>
  173. </div>
  174. </div>
  175. </div>
  176. <!-- =========================== copyright notice ========================== -->
  177. <p class="footer">
  178. Paper.js v0.12.15<br>
  179. Copyright &#169; 2011—2021 <a href="http://www.lehni.org" target="_blank">J&uuml;rg Lehni</a> &amp; <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
  180. <div class="content-end"></div>
  181. </article>
  182. </body>