RadialGradientStyle.html 18 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>JSDoc: Class: RadialGradientStyle</title>
  6. <script src="scripts/prettify/prettify.js"> </script>
  7. <script src="scripts/prettify/lang-css.js"> </script>
  8. <!--[if lt IE 9]>
  9. <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  10. <![endif]-->
  11. <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
  12. <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
  13. </head>
  14. <body>
  15. <div id="main">
  16. <h1 class="page-title">Class: RadialGradientStyle</h1>
  17. <section>
  18. <header>
  19. <h2><span class="attribs"><span class="type-signature"></span></span>RadialGradientStyle<span class="signature">()</span><span class="type-signature"></span></h2>
  20. </header>
  21. <article>
  22. <div class="container-overview">
  23. <h4 class="name" id="RadialGradientStyle"><span class="type-signature"></span>new RadialGradientStyle<span class="signature">()</span><span class="type-signature"></span></h4>
  24. <div class="description">
  25. Radial gradient interpolates colors from a point to another point around up to a starting and finishing radius value.
  26. If the start and end point are the same it interpolates around the starting and ending radius forming a circle. Outside of the radius the color is solid.
  27. The get method returns a CanvasGradient https://developer.mozilla.org/en-US/docs/Web/API/CanvasGradient when generated.
  28. </div>
  29. <dl class="details">
  30. <dt class="tag-source">Source:</dt>
  31. <dd class="tag-source"><ul class="dummy"><li>
  32. <a href="objects_style_RadialGradientStyle.js.html">objects/style/RadialGradientStyle.js</a>, <a href="objects_style_RadialGradientStyle.js.html#line15">line 15</a>
  33. </li></ul></dd>
  34. </dl>
  35. </div>
  36. <h3 class="subsection-title">Extends</h3>
  37. <ul>
  38. <li><a href="GradientStyle.html">GradientStyle</a></li>
  39. </ul>
  40. <h3 class="subsection-title">Members</h3>
  41. <h4 class="name" id="cache"><span class="type-signature"></span>cache<span class="type-signature"> :string|CanvasGradient|CanvasPattern</span></h4>
  42. <div class="description">
  43. Cached style object pre-generated from previous calls. To avoid regenerating the same style object every cycle.
  44. Inherited classes should write their own get method that returns the style object and stores it in this property.
  45. </div>
  46. <h5>Type:</h5>
  47. <ul>
  48. <li>
  49. <span class="param-type">string</span>
  50. |
  51. <span class="param-type">CanvasGradient</span>
  52. |
  53. <span class="param-type">CanvasPattern</span>
  54. </li>
  55. </ul>
  56. <dl class="details">
  57. <dt class="inherited-from">Inherited From:</dt>
  58. <dd class="inherited-from"><ul class="dummy"><li>
  59. <a href="Style.html#cache">Style#cache</a>
  60. </li></ul></dd>
  61. <dt class="tag-source">Source:</dt>
  62. <dd class="tag-source"><ul class="dummy"><li>
  63. <a href="objects_style_Style.js.html">objects/style/Style.js</a>, <a href="objects_style_Style.js.html#line17">line 17</a>
  64. </li></ul></dd>
  65. </dl>
  66. <h4 class="name" id="colors"><span class="type-signature"></span>colors<span class="type-signature"> :Array.&lt;<a href="GradientColorStop.html">GradientColorStop</a>></span></h4>
  67. <div class="description">
  68. List of colors that compose this gradient ordered.
  69. You need to add at least one color stop to have a visible gradient.
  70. </div>
  71. <h5>Type:</h5>
  72. <ul>
  73. <li>
  74. <span class="param-type">Array.&lt;<a href="GradientColorStop.html">GradientColorStop</a>></span>
  75. </li>
  76. </ul>
  77. <dl class="details">
  78. <dt class="inherited-from">Inherited From:</dt>
  79. <dd class="inherited-from"><ul class="dummy"><li>
  80. <a href="GradientStyle.html#colors">GradientStyle#colors</a>
  81. </li></ul></dd>
  82. <dt class="tag-source">Source:</dt>
  83. <dd class="tag-source"><ul class="dummy"><li>
  84. <a href="objects_style_GradientStyle.js.html">objects/style/GradientStyle.js</a>, <a href="objects_style_GradientStyle.js.html#line23">line 23</a>
  85. </li></ul></dd>
  86. </dl>
  87. <h4 class="name" id="end"><span class="type-signature"></span>end<span class="type-signature"> :<a href="Vector2.html">Vector2</a></span></h4>
  88. <div class="description">
  89. The coordinates of the ending circle of the gradient.
  90. </div>
  91. <h5>Type:</h5>
  92. <ul>
  93. <li>
  94. <span class="param-type"><a href="Vector2.html">Vector2</a></span>
  95. </li>
  96. </ul>
  97. <dl class="details">
  98. <dt class="tag-source">Source:</dt>
  99. <dd class="tag-source"><ul class="dummy"><li>
  100. <a href="objects_style_RadialGradientStyle.js.html">objects/style/RadialGradientStyle.js</a>, <a href="objects_style_RadialGradientStyle.js.html#line38">line 38</a>
  101. </li></ul></dd>
  102. </dl>
  103. <h4 class="name" id="endRadius"><span class="type-signature"></span>endRadius<span class="type-signature"> :number</span></h4>
  104. <div class="description">
  105. The radius of the ending circle.
  106. </div>
  107. <h5>Type:</h5>
  108. <ul>
  109. <li>
  110. <span class="param-type">number</span>
  111. </li>
  112. </ul>
  113. <dl class="details">
  114. <dt class="tag-source">Source:</dt>
  115. <dd class="tag-source"><ul class="dummy"><li>
  116. <a href="objects_style_RadialGradientStyle.js.html">objects/style/RadialGradientStyle.js</a>, <a href="objects_style_RadialGradientStyle.js.html#line45">line 45</a>
  117. </li></ul></dd>
  118. </dl>
  119. <h4 class="name" id="needsUpdate"><span class="type-signature"></span>needsUpdate<span class="type-signature"> :boolean</span></h4>
  120. <div class="description">
  121. Indicates if the style object needs to be updated, should be used after applying changed to the style in order to generate a new object.
  122. Inherited classes should implement this functionality.
  123. </div>
  124. <h5>Type:</h5>
  125. <ul>
  126. <li>
  127. <span class="param-type">boolean</span>
  128. </li>
  129. </ul>
  130. <dl class="details">
  131. <dt class="inherited-from">Inherited From:</dt>
  132. <dd class="inherited-from"><ul class="dummy"><li>
  133. <a href="Style.html#needsUpdate">Style#needsUpdate</a>
  134. </li></ul></dd>
  135. <dt class="tag-source">Source:</dt>
  136. <dd class="tag-source"><ul class="dummy"><li>
  137. <a href="objects_style_Style.js.html">objects/style/Style.js</a>, <a href="objects_style_Style.js.html#line26">line 26</a>
  138. </li></ul></dd>
  139. </dl>
  140. <h4 class="name" id="start"><span class="type-signature"></span>start<span class="type-signature"> :<a href="Vector2.html">Vector2</a></span></h4>
  141. <div class="description">
  142. The coordinates of the starting circle of the gradient.
  143. </div>
  144. <h5>Type:</h5>
  145. <ul>
  146. <li>
  147. <span class="param-type"><a href="Vector2.html">Vector2</a></span>
  148. </li>
  149. </ul>
  150. <dl class="details">
  151. <dt class="tag-source">Source:</dt>
  152. <dd class="tag-source"><ul class="dummy"><li>
  153. <a href="objects_style_RadialGradientStyle.js.html">objects/style/RadialGradientStyle.js</a>, <a href="objects_style_RadialGradientStyle.js.html#line24">line 24</a>
  154. </li></ul></dd>
  155. </dl>
  156. <h4 class="name" id="startRadius"><span class="type-signature"></span>startRadius<span class="type-signature"> :number</span></h4>
  157. <div class="description">
  158. The radius of the starting circle.
  159. </div>
  160. <h5>Type:</h5>
  161. <ul>
  162. <li>
  163. <span class="param-type">number</span>
  164. </li>
  165. </ul>
  166. <dl class="details">
  167. <dt class="tag-source">Source:</dt>
  168. <dd class="tag-source"><ul class="dummy"><li>
  169. <a href="objects_style_RadialGradientStyle.js.html">objects/style/RadialGradientStyle.js</a>, <a href="objects_style_RadialGradientStyle.js.html#line31">line 31</a>
  170. </li></ul></dd>
  171. </dl>
  172. <h3 class="subsection-title">Methods</h3>
  173. <h4 class="name" id="addColorStop"><span class="type-signature"></span>addColorStop<span class="signature">(offset, color)</span><span class="type-signature"></span></h4>
  174. <div class="description">
  175. Add a new color stop defined by an offset and a color to the gradient.
  176. If the offset is not between 0 and 1 inclusive, or if color can't be parsed as a CSS color, an error is raised.
  177. </div>
  178. <h5>Parameters:</h5>
  179. <table class="params">
  180. <thead>
  181. <tr>
  182. <th>Name</th>
  183. <th>Type</th>
  184. <th class="last">Description</th>
  185. </tr>
  186. </thead>
  187. <tbody>
  188. <tr>
  189. <td class="name"><code>offset</code></td>
  190. <td class="type">
  191. <span class="param-type">number</span>
  192. </td>
  193. <td class="description last">Offset of the color stop between 0 and 1 inclusive.</td>
  194. </tr>
  195. <tr>
  196. <td class="name"><code>color</code></td>
  197. <td class="type">
  198. <span class="param-type">string</span>
  199. </td>
  200. <td class="description last">CSS color value.</td>
  201. </tr>
  202. </tbody>
  203. </table>
  204. <dl class="details">
  205. <dt class="inherited-from">Inherited From:</dt>
  206. <dd class="inherited-from"><ul class="dummy"><li>
  207. <a href="GradientStyle.html#addColorStop">GradientStyle#addColorStop</a>
  208. </li></ul></dd>
  209. <dt class="tag-source">Source:</dt>
  210. <dd class="tag-source"><ul class="dummy"><li>
  211. <a href="objects_style_GradientStyle.js.html">objects/style/GradientStyle.js</a>, <a href="objects_style_GradientStyle.js.html#line36">line 36</a>
  212. </li></ul></dd>
  213. </dl>
  214. <h4 class="name" id="get"><span class="type-signature"></span>get<span class="signature">(context)</span><span class="type-signature"> &rarr; {string|CanvasGradient|CanvasPattern}</span></h4>
  215. <div class="description">
  216. Get generated style object from style data and the drawing context.
  217. </div>
  218. <h5>Parameters:</h5>
  219. <table class="params">
  220. <thead>
  221. <tr>
  222. <th>Name</th>
  223. <th>Type</th>
  224. <th class="last">Description</th>
  225. </tr>
  226. </thead>
  227. <tbody>
  228. <tr>
  229. <td class="name"><code>context</code></td>
  230. <td class="type">
  231. <span class="param-type">CanvasRenderingContext2D</span>
  232. </td>
  233. <td class="description last">Context being used to draw the object.</td>
  234. </tr>
  235. </tbody>
  236. </table>
  237. <dl class="details">
  238. <dt class="tag-overrides">Overrides:</dt>
  239. <dd class="tag-overrides"><ul class="dummy"><li>
  240. <a href="GradientStyle.html#get">GradientStyle#get</a>
  241. </li></ul></dd>
  242. <dt class="tag-source">Source:</dt>
  243. <dd class="tag-source"><ul class="dummy"><li>
  244. <a href="objects_style_Style.js.html">objects/style/Style.js</a>, <a href="objects_style_Style.js.html#line35">line 35</a>
  245. </li></ul></dd>
  246. </dl>
  247. <h5>Returns:</h5>
  248. <div class="param-desc">
  249. Return the canvas style object generated.
  250. </div>
  251. <dl>
  252. <dt>
  253. Type
  254. </dt>
  255. <dd>
  256. <span class="param-type">string</span>
  257. |
  258. <span class="param-type">CanvasGradient</span>
  259. |
  260. <span class="param-type">CanvasPattern</span>
  261. </dd>
  262. </dl>
  263. <h4 class="name" id="parse"><span class="type-signature"></span>parse<span class="signature">(data)</span><span class="type-signature"></span></h4>
  264. <div class="description">
  265. Parse the style attributes from JSON object data created with the serialize() method.
  266. </div>
  267. <h5>Parameters:</h5>
  268. <table class="params">
  269. <thead>
  270. <tr>
  271. <th>Name</th>
  272. <th>Type</th>
  273. <th class="last">Description</th>
  274. </tr>
  275. </thead>
  276. <tbody>
  277. <tr>
  278. <td class="name"><code>data</code></td>
  279. <td class="type">
  280. <span class="param-type">Object</span>
  281. </td>
  282. <td class="description last">Serialized style data.</td>
  283. </tr>
  284. </tbody>
  285. </table>
  286. <dl class="details">
  287. <dt class="tag-overrides">Overrides:</dt>
  288. <dd class="tag-overrides"><ul class="dummy"><li>
  289. <a href="GradientStyle.html#parse">GradientStyle#parse</a>
  290. </li></ul></dd>
  291. <dt class="tag-source">Source:</dt>
  292. <dd class="tag-source"><ul class="dummy"><li>
  293. <a href="objects_style_Style.js.html">objects/style/Style.js</a>, <a href="objects_style_Style.js.html#line49">line 49</a>
  294. </li></ul></dd>
  295. </dl>
  296. <h4 class="name" id="serialize"><span class="type-signature"></span>serialize<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h4>
  297. <div class="description">
  298. Serialize the style to JSON object, called by the objects using these styles.
  299. </div>
  300. <dl class="details">
  301. <dt class="tag-overrides">Overrides:</dt>
  302. <dd class="tag-overrides"><ul class="dummy"><li>
  303. <a href="GradientStyle.html#serialize">GradientStyle#serialize</a>
  304. </li></ul></dd>
  305. <dt class="tag-source">Source:</dt>
  306. <dd class="tag-source"><ul class="dummy"><li>
  307. <a href="objects_style_Style.js.html">objects/style/Style.js</a>, <a href="objects_style_Style.js.html#line42">line 42</a>
  308. </li></ul></dd>
  309. </dl>
  310. <h5>Returns:</h5>
  311. <div class="param-desc">
  312. Serialized style data.
  313. </div>
  314. <dl>
  315. <dt>
  316. Type
  317. </dt>
  318. <dd>
  319. <span class="param-type">Object</span>
  320. </dd>
  321. </dl>
  322. </article>
  323. </section>
  324. </div>
  325. <nav>
  326. <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AnimationTimer.html">AnimationTimer</a></li><li><a href="BarGraph.html">BarGraph</a></li><li><a href="BezierCurve.html">BezierCurve</a></li><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="BoxMask.html">BoxMask</a></li><li><a href="Circle.html">Circle</a></li><li><a href="ColorStyle.html">ColorStyle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="FileUtils.html">FileUtils</a></li><li><a href="Gauge.html">Gauge</a></li><li><a href="GradientColorStop.html">GradientColorStop</a></li><li><a href="GradientStyle.html">GradientStyle</a></li><li><a href="Graph.html">Graph</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="LinearGradientStyle.html">LinearGradientStyle</a></li><li><a href="Mask.html">Mask</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="MultiLineText.html">MultiLineText</a></li><li><a href="Node.html">Node</a></li><li><a href="NodeConnector.html">NodeConnector</a></li><li><a href="NodeGraph.html">NodeGraph</a></li><li><a href="NodeSocket.html">NodeSocket</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Path.html">Path</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="PatternStyle.html">PatternStyle</a></li><li><a href="PieChart.html">PieChart</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="QuadraticCurve.html">QuadraticCurve</a></li><li><a href="RadialGradientStyle.html">RadialGradientStyle</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="RoundedBox.html">RoundedBox</a></li><li><a href="ScatterGraph.html">ScatterGraph</a></li><li><a href="Style.html">Style</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li><li><a href="ViewportControls.html">ViewportControls</a></li></ul><h3>Global</h3><ul><li><a href="global.html#writeFile">writeFile</a></li></ul>
  327. </nav>
  328. <br class="clear">
  329. <footer>
  330. Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Sat Sep 17 2022 14:24:36 GMT+0100 (Hora de verão da Europa Ocidental)
  331. </footer>
  332. <script> prettyPrint(); </script>
  333. <script src="scripts/linenumber.js"> </script>
  334. </body>
  335. </html>