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.

239 lines
4.9 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Gradient</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>Gradient</h1>
  17. <p>The Gradient object.</p>
  18. <h4>Example:<span class="description">Applying a linear gradient color containing evenly distributed color stops:</span></h4>
  19. <div class="paperscript split">
  20. <div class="buttons">
  21. <div class="button run">Run</div>
  22. </div>
  23. <script type="text/paperscript" canvas="canvas-0">
  24. // Define two points which we will be using to construct
  25. // the path and to position the gradient color:
  26. var topLeft = view.center - [80, 80];
  27. var bottomRight = view.center + [80, 80];
  28. // Create a rectangle shaped path between
  29. // the topLeft and bottomRight points:
  30. var path = new Path.Rectangle({
  31. topLeft: topLeft,
  32. bottomRight: bottomRight,
  33. // Fill the path with a gradient of three color stops
  34. // that runs between the two points we defined earlier:
  35. fillColor: {
  36. gradient: {
  37. stops: ['yellow', 'red', 'blue']
  38. },
  39. origin: topLeft,
  40. destination: bottomRight
  41. }
  42. });
  43. </script>
  44. <div class="canvas"><canvas width="516" height="300" id="canvas-0"></canvas></div>
  45. </div>
  46. <h4>Example:<span class="description">Create a circle shaped path at the center of the view, using 40% of the height of the view as its radius and fill it with a radial gradient color:</span></h4>
  47. <div class="paperscript split">
  48. <div class="buttons">
  49. <div class="button run">Run</div>
  50. </div>
  51. <script type="text/paperscript" canvas="canvas-1">
  52. var path = new Path.Circle({
  53. center: view.center,
  54. radius: view.bounds.height * 0.4
  55. });
  56. // Fill the path with a radial gradient color with three stops:
  57. // yellow from 0% to 5%, mix between red from 5% to 20%,
  58. // mix between red and black from 20% to 100%:
  59. path.fillColor = {
  60. gradient: {
  61. stops: [['yellow', 0.05], ['red', 0.2], ['black', 1]],
  62. radial: true
  63. },
  64. origin: path.position,
  65. destination: path.bounds.rightCenter
  66. };
  67. </script>
  68. <div class="canvas"><canvas width="516" height="300" id="canvas-1"></canvas></div>
  69. </div>
  70. </div>
  71. <!-- ================================ properties =========================== -->
  72. <div class="reference-members">
  73. <h2>Properties</h2>
  74. <div id="stops" class="member">
  75. <div class="member-link">
  76. <a name="stops" href="#stops"><tt><b>stops</b></tt></a>
  77. </div>
  78. <div class="member-description hidden">
  79. <div class="member-text">
  80. <p>The gradient stops on the gradient ramp.</p>
  81. <ul class="member-list">
  82. <h4>Type:</h4>
  83. <li>
  84. Array of <a href="../classes/GradientStop.html"><tt>GradientStop</tt></a> objects
  85. </li>
  86. </ul>
  87. </div>
  88. </div>
  89. </div>
  90. <div id="radial" class="member">
  91. <div class="member-link">
  92. <a name="radial" href="#radial"><tt><b>radial</b></tt></a>
  93. </div>
  94. <div class="member-description hidden">
  95. <div class="member-text">
  96. <p>Specifies whether the gradient is radial or linear.</p>
  97. <ul class="member-list">
  98. <h4>Type:</h4>
  99. <li>
  100. <tt>Boolean</tt>
  101. </li>
  102. </ul>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. <!-- ============================== methods ================================ -->
  108. <div class="reference-members">
  109. <h2>Methods</h2>
  110. <div id="clone" class="member">
  111. <div class="member-link">
  112. <a name="clone" href="#clone"><tt><b>clone</b>()</tt></a>
  113. </div>
  114. <div class="member-description hidden">
  115. <div class="member-text">
  116. <ul class="member-list">
  117. <h4>Returns:</h4>
  118. <li>
  119. <tt><a href="../classes/Gradient.html"><tt>Gradient</tt></a></tt>&nbsp;&mdash;&nbsp;a copy of the gradient
  120. </li>
  121. </ul>
  122. </div>
  123. </div>
  124. </div>
  125. <div id="equals-gradient" class="member">
  126. <div class="member-link">
  127. <a name="equals-gradient" href="#equals-gradient"><tt><b>equals</b>(gradient)</tt></a>
  128. </div>
  129. <div class="member-description hidden">
  130. <div class="member-text">
  131. <p>Checks whether the gradient is equal to the supplied gradient.</p>
  132. <ul class="member-list">
  133. <h4>Parameters:</h4>
  134. <li>
  135. <tt>gradient:</tt>
  136. <a href="../classes/Gradient.html"><tt>Gradient</tt></a>
  137. </li>
  138. </ul>
  139. <ul class="member-list">
  140. <h4>Returns:</h4>
  141. <li>
  142. <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if they are equal, <tt>false</tt> otherwise
  143. </li>
  144. </ul>
  145. </div>
  146. </div>
  147. </div>
  148. </div>
  149. <!-- =========================== copyright notice ========================== -->
  150. <p class="footer">
  151. Paper.js v0.12.15<br>
  152. 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>
  153. <div class="content-end"></div>
  154. </article>
  155. </body>