ColorStyle.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>JSDoc: Class: ColorStyle</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: ColorStyle</h1>
  17. <section>
  18. <header>
  19. <h2><span class="attribs"><span class="type-signature"></span></span>ColorStyle<span class="signature">(color)</span><span class="type-signature"></span></h2>
  20. </header>
  21. <article>
  22. <div class="container-overview">
  23. <h4 class="name" id="ColorStyle"><span class="type-signature"></span>new ColorStyle<span class="signature">(color)</span><span class="type-signature"></span></h4>
  24. <div class="description">
  25. Simple solid color style represented and stored as a CSS color.
  26. Example value formats supported "rgb(0, 153, 255)" or "rgba(0, 153, 255, 0.3)" or "#0099ff" or "#0099ffaa" or "red".
  27. </div>
  28. <h5>Parameters:</h5>
  29. <table class="params">
  30. <thead>
  31. <tr>
  32. <th>Name</th>
  33. <th>Type</th>
  34. <th class="last">Description</th>
  35. </tr>
  36. </thead>
  37. <tbody>
  38. <tr>
  39. <td class="name"><code>color</code></td>
  40. <td class="type">
  41. <span class="param-type">string</span>
  42. </td>
  43. <td class="description last">Color of the style, if undefined it is set to black.</td>
  44. </tr>
  45. </tbody>
  46. </table>
  47. <dl class="details">
  48. <dt class="tag-source">Source:</dt>
  49. <dd class="tag-source"><ul class="dummy"><li>
  50. <a href="objects_style_ColorStyle.js.html">objects/style/ColorStyle.js</a>, <a href="objects_style_ColorStyle.js.html#line12">line 12</a>
  51. </li></ul></dd>
  52. </dl>
  53. </div>
  54. <h3 class="subsection-title">Extends</h3>
  55. <ul>
  56. <li><a href="Style.html">Style</a></li>
  57. </ul>
  58. <h3 class="subsection-title">Members</h3>
  59. <h4 class="name" id="cache"><span class="type-signature"></span>cache<span class="type-signature"> :string|CanvasGradient|CanvasPattern</span></h4>
  60. <div class="description">
  61. Cached style object pre-generated from previous calls. To avoid regenerating the same style object every cycle.
  62. Inherited classes should write their own get method that returns the style object and stores it in this property.
  63. </div>
  64. <h5>Type:</h5>
  65. <ul>
  66. <li>
  67. <span class="param-type">string</span>
  68. |
  69. <span class="param-type">CanvasGradient</span>
  70. |
  71. <span class="param-type">CanvasPattern</span>
  72. </li>
  73. </ul>
  74. <dl class="details">
  75. <dt class="inherited-from">Inherited From:</dt>
  76. <dd class="inherited-from"><ul class="dummy"><li>
  77. <a href="Style.html#cache">Style#cache</a>
  78. </li></ul></dd>
  79. <dt class="tag-source">Source:</dt>
  80. <dd class="tag-source"><ul class="dummy"><li>
  81. <a href="objects_style_Style.js.html">objects/style/Style.js</a>, <a href="objects_style_Style.js.html#line17">line 17</a>
  82. </li></ul></dd>
  83. </dl>
  84. <h4 class="name" id="color"><span class="type-signature"></span>color<span class="type-signature"> :string</span></h4>
  85. <div class="description">
  86. Color of this style object.
  87. </div>
  88. <h5>Type:</h5>
  89. <ul>
  90. <li>
  91. <span class="param-type">string</span>
  92. </li>
  93. </ul>
  94. <dl class="details">
  95. <dt class="tag-source">Source:</dt>
  96. <dd class="tag-source"><ul class="dummy"><li>
  97. <a href="objects_style_ColorStyle.js.html">objects/style/ColorStyle.js</a>, <a href="objects_style_ColorStyle.js.html#line21">line 21</a>
  98. </li></ul></dd>
  99. </dl>
  100. <h4 class="name" id="needsUpdate"><span class="type-signature"></span>needsUpdate<span class="type-signature"> :boolean</span></h4>
  101. <div class="description">
  102. 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.
  103. Inherited classes should implement this functionality.
  104. </div>
  105. <h5>Type:</h5>
  106. <ul>
  107. <li>
  108. <span class="param-type">boolean</span>
  109. </li>
  110. </ul>
  111. <dl class="details">
  112. <dt class="inherited-from">Inherited From:</dt>
  113. <dd class="inherited-from"><ul class="dummy"><li>
  114. <a href="Style.html#needsUpdate">Style#needsUpdate</a>
  115. </li></ul></dd>
  116. <dt class="tag-source">Source:</dt>
  117. <dd class="tag-source"><ul class="dummy"><li>
  118. <a href="objects_style_Style.js.html">objects/style/Style.js</a>, <a href="objects_style_Style.js.html#line26">line 26</a>
  119. </li></ul></dd>
  120. </dl>
  121. <h3 class="subsection-title">Methods</h3>
  122. <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>
  123. <div class="description">
  124. Get generated style object from style data and the drawing context.
  125. </div>
  126. <h5>Parameters:</h5>
  127. <table class="params">
  128. <thead>
  129. <tr>
  130. <th>Name</th>
  131. <th>Type</th>
  132. <th class="last">Description</th>
  133. </tr>
  134. </thead>
  135. <tbody>
  136. <tr>
  137. <td class="name"><code>context</code></td>
  138. <td class="type">
  139. <span class="param-type">CanvasRenderingContext2D</span>
  140. </td>
  141. <td class="description last">Context being used to draw the object.</td>
  142. </tr>
  143. </tbody>
  144. </table>
  145. <dl class="details">
  146. <dt class="tag-overrides">Overrides:</dt>
  147. <dd class="tag-overrides"><ul class="dummy"><li>
  148. <a href="Style.html#get">Style#get</a>
  149. </li></ul></dd>
  150. <dt class="tag-source">Source:</dt>
  151. <dd class="tag-source"><ul class="dummy"><li>
  152. <a href="objects_style_Style.js.html">objects/style/Style.js</a>, <a href="objects_style_Style.js.html#line35">line 35</a>
  153. </li></ul></dd>
  154. </dl>
  155. <h5>Returns:</h5>
  156. <div class="param-desc">
  157. Return the canvas style object generated.
  158. </div>
  159. <dl>
  160. <dt>
  161. Type
  162. </dt>
  163. <dd>
  164. <span class="param-type">string</span>
  165. |
  166. <span class="param-type">CanvasGradient</span>
  167. |
  168. <span class="param-type">CanvasPattern</span>
  169. </dd>
  170. </dl>
  171. <h4 class="name" id="parse"><span class="type-signature"></span>parse<span class="signature">(data)</span><span class="type-signature"></span></h4>
  172. <div class="description">
  173. Parse the style attributes from JSON object data created with the serialize() method.
  174. </div>
  175. <h5>Parameters:</h5>
  176. <table class="params">
  177. <thead>
  178. <tr>
  179. <th>Name</th>
  180. <th>Type</th>
  181. <th class="last">Description</th>
  182. </tr>
  183. </thead>
  184. <tbody>
  185. <tr>
  186. <td class="name"><code>data</code></td>
  187. <td class="type">
  188. <span class="param-type">Object</span>
  189. </td>
  190. <td class="description last">Serialized style data.</td>
  191. </tr>
  192. </tbody>
  193. </table>
  194. <dl class="details">
  195. <dt class="tag-overrides">Overrides:</dt>
  196. <dd class="tag-overrides"><ul class="dummy"><li>
  197. <a href="Style.html#parse">Style#parse</a>
  198. </li></ul></dd>
  199. <dt class="tag-source">Source:</dt>
  200. <dd class="tag-source"><ul class="dummy"><li>
  201. <a href="objects_style_Style.js.html">objects/style/Style.js</a>, <a href="objects_style_Style.js.html#line49">line 49</a>
  202. </li></ul></dd>
  203. </dl>
  204. <h4 class="name" id="serialize"><span class="type-signature"></span>serialize<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h4>
  205. <div class="description">
  206. Serialize the style to JSON object, called by the objects using these styles.
  207. </div>
  208. <dl class="details">
  209. <dt class="tag-overrides">Overrides:</dt>
  210. <dd class="tag-overrides"><ul class="dummy"><li>
  211. <a href="Style.html#serialize">Style#serialize</a>
  212. </li></ul></dd>
  213. <dt class="tag-source">Source:</dt>
  214. <dd class="tag-source"><ul class="dummy"><li>
  215. <a href="objects_style_Style.js.html">objects/style/Style.js</a>, <a href="objects_style_Style.js.html#line42">line 42</a>
  216. </li></ul></dd>
  217. </dl>
  218. <h5>Returns:</h5>
  219. <div class="param-desc">
  220. Serialized style data.
  221. </div>
  222. <dl>
  223. <dt>
  224. Type
  225. </dt>
  226. <dd>
  227. <span class="param-type">Object</span>
  228. </dd>
  229. </dl>
  230. </article>
  231. </section>
  232. </div>
  233. <nav>
  234. <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>
  235. </nav>
  236. <br class="clear">
  237. <footer>
  238. 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)
  239. </footer>
  240. <script> prettyPrint(); </script>
  241. <script src="scripts/linenumber.js"> </script>
  242. </body>
  243. </html>