@tsparticles/engine 3.0.0-alpha.1 → 3.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (329) hide show
  1. package/README.md +244 -188
  2. package/browser/Core/Canvas.js +271 -241
  3. package/browser/Core/Container.js +90 -106
  4. package/browser/Core/Engine.js +271 -0
  5. package/browser/Core/Particle.js +158 -165
  6. package/browser/Core/Particles.js +148 -143
  7. package/browser/Core/Retina.js +15 -13
  8. package/browser/Core/Utils/Circle.js +10 -6
  9. package/browser/Core/Utils/Constants.js +4 -3
  10. package/browser/Core/Utils/EventListeners.js +258 -234
  11. package/browser/Core/Utils/InteractionManager.js +6 -16
  12. package/browser/Core/Utils/QuadTree.js +14 -20
  13. package/browser/Core/Utils/Vector3d.js +17 -9
  14. package/browser/Options/Classes/AnimatableColor.js +2 -1
  15. package/browser/Options/Classes/AnimationOptions.js +4 -3
  16. package/browser/Options/Classes/BackgroundMask/BackgroundMask.js +2 -1
  17. package/browser/Options/Classes/ColorAnimation.js +4 -0
  18. package/browser/Options/Classes/Interactivity/Events/DivEvent.js +0 -24
  19. package/browser/Options/Classes/Interactivity/Events/Events.js +5 -24
  20. package/browser/Options/Classes/Interactivity/Interactivity.js +1 -8
  21. package/browser/Options/Classes/Interactivity/Modes/Modes.js +11 -8
  22. package/browser/Options/Classes/ManualParticle.js +5 -6
  23. package/browser/Options/Classes/Options.js +19 -39
  24. package/browser/Options/Classes/OptionsColor.js +3 -2
  25. package/browser/Options/Classes/Particles/Collisions/Collisions.js +5 -0
  26. package/browser/Options/Classes/Particles/Move/Move.js +11 -41
  27. package/browser/Options/Classes/Particles/Move/MoveAttract.js +9 -20
  28. package/browser/Options/Classes/Particles/Move/MoveTrail.js +2 -8
  29. package/browser/Options/Classes/Particles/Move/OutModes.js +4 -5
  30. package/browser/Options/Classes/Particles/Move/Spin.js +3 -1
  31. package/browser/Options/Classes/Particles/Number/ParticlesDensity.js +2 -21
  32. package/browser/Options/Classes/Particles/Number/ParticlesNumber.js +2 -9
  33. package/browser/Options/Classes/Particles/Opacity/Opacity.js +11 -7
  34. package/browser/Options/Classes/Particles/Opacity/OpacityAnimation.js +0 -9
  35. package/browser/Options/Classes/Particles/ParticlesOptions.js +6 -11
  36. package/browser/Options/Classes/Particles/Shape/Shape.js +9 -10
  37. package/browser/Options/Classes/Particles/Size/Size.js +11 -7
  38. package/browser/Options/Classes/Particles/Size/SizeAnimation.js +0 -9
  39. package/browser/Options/Classes/ValueWithRandom.js +4 -17
  40. package/browser/Utils/CanvasUtils.js +18 -54
  41. package/browser/Utils/ColorUtils.js +17 -19
  42. package/browser/Utils/EventDispatcher.js +7 -6
  43. package/browser/Utils/HslColorManager.js +2 -4
  44. package/browser/Utils/NumberUtils.js +41 -45
  45. package/browser/Utils/RgbColorManager.js +2 -4
  46. package/browser/Utils/Utils.js +133 -62
  47. package/browser/bundle.js +4 -97
  48. package/browser/export-types.js +97 -0
  49. package/browser/exports.js +89 -0
  50. package/browser/index.js +8 -199
  51. package/browser/init.js +12 -0
  52. package/cjs/Core/Canvas.js +269 -239
  53. package/cjs/Core/Container.js +90 -106
  54. package/cjs/Core/Engine.js +275 -0
  55. package/cjs/Core/Particle.js +157 -164
  56. package/cjs/Core/Particles.js +148 -143
  57. package/cjs/Core/Retina.js +15 -13
  58. package/cjs/Core/Utils/Circle.js +10 -6
  59. package/cjs/Core/Utils/Constants.js +5 -4
  60. package/cjs/Core/Utils/EventListeners.js +257 -233
  61. package/cjs/Core/Utils/InteractionManager.js +6 -16
  62. package/cjs/Core/Utils/QuadTree.js +14 -20
  63. package/cjs/Core/Utils/Vector3d.js +17 -9
  64. package/cjs/Options/Classes/AnimatableColor.js +2 -1
  65. package/cjs/Options/Classes/AnimationOptions.js +4 -3
  66. package/cjs/Options/Classes/BackgroundMask/BackgroundMask.js +2 -1
  67. package/cjs/Options/Classes/ColorAnimation.js +4 -0
  68. package/cjs/Options/Classes/Interactivity/Events/DivEvent.js +0 -24
  69. package/cjs/Options/Classes/Interactivity/Events/Events.js +5 -24
  70. package/cjs/Options/Classes/Interactivity/Interactivity.js +1 -8
  71. package/cjs/Options/Classes/Interactivity/Modes/Modes.js +11 -8
  72. package/cjs/Options/Classes/ManualParticle.js +5 -6
  73. package/cjs/Options/Classes/Options.js +18 -38
  74. package/cjs/Options/Classes/OptionsColor.js +3 -2
  75. package/cjs/Options/Classes/Particles/Collisions/Collisions.js +5 -0
  76. package/cjs/Options/Classes/Particles/Move/Move.js +11 -41
  77. package/cjs/Options/Classes/Particles/Move/MoveAttract.js +9 -20
  78. package/cjs/Options/Classes/Particles/Move/MoveTrail.js +2 -8
  79. package/cjs/Options/Classes/Particles/Move/OutModes.js +4 -5
  80. package/cjs/Options/Classes/Particles/Move/Spin.js +3 -1
  81. package/cjs/Options/Classes/Particles/Number/ParticlesDensity.js +2 -21
  82. package/cjs/Options/Classes/Particles/Number/ParticlesNumber.js +2 -9
  83. package/cjs/Options/Classes/Particles/Opacity/Opacity.js +10 -6
  84. package/cjs/Options/Classes/Particles/Opacity/OpacityAnimation.js +0 -9
  85. package/cjs/Options/Classes/Particles/ParticlesOptions.js +6 -11
  86. package/cjs/Options/Classes/Particles/Shape/Shape.js +9 -10
  87. package/cjs/Options/Classes/Particles/Size/Size.js +11 -7
  88. package/cjs/Options/Classes/Particles/Size/SizeAnimation.js +0 -9
  89. package/cjs/Options/Classes/ValueWithRandom.js +4 -17
  90. package/cjs/Utils/CanvasUtils.js +21 -58
  91. package/cjs/Utils/ColorUtils.js +16 -18
  92. package/cjs/Utils/EventDispatcher.js +7 -6
  93. package/cjs/Utils/HslColorManager.js +2 -4
  94. package/cjs/Utils/NumberUtils.js +41 -45
  95. package/cjs/Utils/RgbColorManager.js +2 -4
  96. package/cjs/Utils/Utils.js +146 -66
  97. package/cjs/bundle.js +4 -97
  98. package/cjs/export-types.js +113 -0
  99. package/cjs/exports.js +105 -0
  100. package/cjs/index.js +8 -199
  101. package/cjs/init.js +16 -0
  102. package/esm/Core/Canvas.js +271 -241
  103. package/esm/Core/Container.js +90 -106
  104. package/esm/Core/Engine.js +271 -0
  105. package/esm/Core/Particle.js +158 -165
  106. package/esm/Core/Particles.js +148 -143
  107. package/esm/Core/Retina.js +15 -13
  108. package/esm/Core/Utils/Circle.js +10 -6
  109. package/esm/Core/Utils/Constants.js +4 -3
  110. package/esm/Core/Utils/EventListeners.js +258 -234
  111. package/esm/Core/Utils/InteractionManager.js +6 -16
  112. package/esm/Core/Utils/QuadTree.js +14 -20
  113. package/esm/Core/Utils/Vector3d.js +17 -9
  114. package/esm/Options/Classes/AnimatableColor.js +2 -1
  115. package/esm/Options/Classes/AnimationOptions.js +4 -3
  116. package/esm/Options/Classes/BackgroundMask/BackgroundMask.js +2 -1
  117. package/esm/Options/Classes/ColorAnimation.js +4 -0
  118. package/esm/Options/Classes/Interactivity/Events/DivEvent.js +0 -24
  119. package/esm/Options/Classes/Interactivity/Events/Events.js +5 -24
  120. package/esm/Options/Classes/Interactivity/Interactivity.js +1 -8
  121. package/esm/Options/Classes/Interactivity/Modes/Modes.js +11 -8
  122. package/esm/Options/Classes/ManualParticle.js +5 -6
  123. package/esm/Options/Classes/Options.js +19 -39
  124. package/esm/Options/Classes/OptionsColor.js +3 -2
  125. package/esm/Options/Classes/Particles/Collisions/Collisions.js +5 -0
  126. package/esm/Options/Classes/Particles/Move/Move.js +11 -41
  127. package/esm/Options/Classes/Particles/Move/MoveAttract.js +9 -20
  128. package/esm/Options/Classes/Particles/Move/MoveTrail.js +2 -8
  129. package/esm/Options/Classes/Particles/Move/OutModes.js +4 -5
  130. package/esm/Options/Classes/Particles/Move/Spin.js +3 -1
  131. package/esm/Options/Classes/Particles/Number/ParticlesDensity.js +2 -21
  132. package/esm/Options/Classes/Particles/Number/ParticlesNumber.js +2 -9
  133. package/esm/Options/Classes/Particles/Opacity/Opacity.js +11 -7
  134. package/esm/Options/Classes/Particles/Opacity/OpacityAnimation.js +0 -9
  135. package/esm/Options/Classes/Particles/ParticlesOptions.js +6 -11
  136. package/esm/Options/Classes/Particles/Shape/Shape.js +9 -10
  137. package/esm/Options/Classes/Particles/Size/Size.js +11 -7
  138. package/esm/Options/Classes/Particles/Size/SizeAnimation.js +0 -9
  139. package/esm/Options/Classes/ValueWithRandom.js +4 -17
  140. package/esm/Utils/CanvasUtils.js +18 -54
  141. package/esm/Utils/ColorUtils.js +17 -19
  142. package/esm/Utils/EventDispatcher.js +7 -6
  143. package/esm/Utils/HslColorManager.js +2 -4
  144. package/esm/Utils/NumberUtils.js +41 -45
  145. package/esm/Utils/RgbColorManager.js +2 -4
  146. package/esm/Utils/Utils.js +133 -62
  147. package/esm/bundle.js +4 -97
  148. package/esm/export-types.js +97 -0
  149. package/esm/exports.js +89 -0
  150. package/esm/index.js +8 -199
  151. package/esm/init.js +12 -0
  152. package/package.json +17 -2
  153. package/report.html +4 -4
  154. package/scripts/install.js +90 -33
  155. package/tsparticles.engine.js +1832 -2007
  156. package/tsparticles.engine.min.js +1 -1
  157. package/tsparticles.engine.min.js.LICENSE.txt +1 -10
  158. package/types/Core/Canvas.d.ts +20 -16
  159. package/types/Core/Container.d.ts +10 -14
  160. package/types/Core/Engine.d.ts +71 -0
  161. package/types/Core/Interfaces/IContainerPlugin.d.ts +2 -0
  162. package/types/Core/Interfaces/ICoordinates.d.ts +2 -2
  163. package/types/Core/Interfaces/IDimension.d.ts +2 -2
  164. package/types/Core/Interfaces/IMovePathGenerator.d.ts +2 -1
  165. package/types/Core/Interfaces/IParticleUpdater.d.ts +0 -2
  166. package/types/Core/Interfaces/IParticleValueAnimation.d.ts +2 -0
  167. package/types/Core/Interfaces/IPlugin.d.ts +4 -3
  168. package/types/Core/Particle.d.ts +7 -7
  169. package/types/Core/Particles.d.ts +14 -11
  170. package/types/Core/Utils/Constants.d.ts +4 -3
  171. package/types/Core/Utils/EventListeners.d.ts +20 -18
  172. package/types/Core/Utils/InteractionManager.d.ts +1 -1
  173. package/types/Core/Utils/QuadTree.d.ts +2 -5
  174. package/types/Core/Utils/Vector3d.d.ts +2 -1
  175. package/types/Enums/Modes/{SizeMode.d.ts → PixelMode.d.ts} +1 -1
  176. package/types/Options/Classes/AnimationOptions.d.ts +1 -1
  177. package/types/Options/Classes/ColorAnimation.d.ts +1 -0
  178. package/types/Options/Classes/Interactivity/Events/DivEvent.d.ts +0 -6
  179. package/types/Options/Classes/Interactivity/Events/Events.d.ts +0 -6
  180. package/types/Options/Classes/Interactivity/Interactivity.d.ts +1 -3
  181. package/types/Options/Classes/Interactivity/Modes/Modes.d.ts +1 -1
  182. package/types/Options/Classes/Options.d.ts +5 -12
  183. package/types/Options/Classes/Particles/Collisions/Collisions.d.ts +2 -0
  184. package/types/Options/Classes/Particles/Move/Move.d.ts +0 -11
  185. package/types/Options/Classes/Particles/Move/MoveAttract.d.ts +0 -4
  186. package/types/Options/Classes/Particles/Move/MoveCenter.d.ts +2 -2
  187. package/types/Options/Classes/Particles/Move/MoveTrail.d.ts +0 -3
  188. package/types/Options/Classes/Particles/Number/ParticlesDensity.d.ts +0 -6
  189. package/types/Options/Classes/Particles/Number/ParticlesNumber.d.ts +0 -2
  190. package/types/Options/Classes/Particles/Opacity/Opacity.d.ts +4 -4
  191. package/types/Options/Classes/Particles/Opacity/OpacityAnimation.d.ts +0 -2
  192. package/types/Options/Classes/Particles/ParticlesOptions.d.ts +1 -1
  193. package/types/Options/Classes/Particles/Size/Size.d.ts +4 -4
  194. package/types/Options/Classes/Particles/Size/SizeAnimation.d.ts +0 -2
  195. package/types/Options/Classes/Responsive.d.ts +3 -3
  196. package/types/Options/Classes/Theme/Theme.d.ts +2 -2
  197. package/types/Options/Classes/ValueWithRandom.d.ts +2 -6
  198. package/types/Options/Interfaces/IAnimation.d.ts +1 -1
  199. package/types/Options/Interfaces/IOptions.d.ts +1 -4
  200. package/types/Options/Interfaces/IResponsive.d.ts +4 -3
  201. package/types/Options/Interfaces/Interactivity/Events/IDivEvent.d.ts +0 -3
  202. package/types/Options/Interfaces/Interactivity/Events/IEvents.d.ts +0 -3
  203. package/types/Options/Interfaces/Interactivity/IInteractivity.d.ts +0 -1
  204. package/types/Options/Interfaces/Interactivity/Modes/IModeDiv.d.ts +0 -1
  205. package/types/Options/Interfaces/Particles/Collisions/ICollisions.d.ts +2 -0
  206. package/types/Options/Interfaces/Particles/IStroke.d.ts +2 -1
  207. package/types/Options/Interfaces/Particles/Move/IMove.d.ts +0 -5
  208. package/types/Options/Interfaces/Particles/Move/IMoveAttract.d.ts +0 -2
  209. package/types/Options/Interfaces/Particles/Move/IMoveTrail.d.ts +0 -2
  210. package/types/Options/Interfaces/Particles/Number/IParticlesDensity.d.ts +0 -3
  211. package/types/Options/Interfaces/Particles/Number/IParticlesNumber.d.ts +0 -1
  212. package/types/Options/Interfaces/Particles/Opacity/IOpacity.d.ts +0 -1
  213. package/types/Options/Interfaces/Particles/Opacity/IOpacityAnimation.d.ts +0 -1
  214. package/types/Options/Interfaces/Particles/Size/ISize.d.ts +0 -1
  215. package/types/Options/Interfaces/Particles/Size/ISizeAnimation.d.ts +0 -1
  216. package/types/Options/Interfaces/Theme/ITheme.d.ts +3 -2
  217. package/types/Types/ExportResult.d.ts +5 -0
  218. package/types/Utils/CanvasUtils.d.ts +2 -5
  219. package/types/Utils/OptionsUtils.d.ts +1 -1
  220. package/types/Utils/Utils.d.ts +22 -4
  221. package/types/bundle.d.ts +2 -91
  222. package/types/export-types.d.ts +107 -0
  223. package/types/exports.d.ts +89 -0
  224. package/types/index.d.ts +3 -204
  225. package/types/init.d.ts +2 -0
  226. package/umd/Core/Canvas.js +269 -239
  227. package/umd/Core/Container.js +91 -107
  228. package/umd/Core/Engine.js +285 -0
  229. package/umd/Core/Particle.js +158 -165
  230. package/umd/Core/Particles.js +149 -144
  231. package/umd/Core/Retina.js +15 -13
  232. package/umd/Core/Utils/Circle.js +11 -7
  233. package/umd/Core/Utils/Constants.js +5 -4
  234. package/umd/Core/Utils/EventListeners.js +257 -233
  235. package/umd/Core/Utils/InteractionManager.js +6 -16
  236. package/umd/Core/Utils/QuadTree.js +14 -20
  237. package/umd/Core/Utils/Vector3d.js +18 -10
  238. package/umd/Options/Classes/AnimatableColor.js +3 -2
  239. package/umd/Options/Classes/AnimationOptions.js +4 -3
  240. package/umd/Options/Classes/BackgroundMask/BackgroundMask.js +3 -2
  241. package/umd/Options/Classes/ColorAnimation.js +4 -0
  242. package/umd/Options/Classes/Interactivity/Events/DivEvent.js +1 -25
  243. package/umd/Options/Classes/Interactivity/Events/Events.js +6 -25
  244. package/umd/Options/Classes/Interactivity/Interactivity.js +1 -8
  245. package/umd/Options/Classes/Interactivity/Modes/Modes.js +11 -8
  246. package/umd/Options/Classes/ManualParticle.js +5 -6
  247. package/umd/Options/Classes/Options.js +18 -38
  248. package/umd/Options/Classes/OptionsColor.js +4 -3
  249. package/umd/Options/Classes/Particles/Collisions/Collisions.js +6 -1
  250. package/umd/Options/Classes/Particles/Move/Move.js +12 -42
  251. package/umd/Options/Classes/Particles/Move/MoveAttract.js +9 -20
  252. package/umd/Options/Classes/Particles/Move/MoveTrail.js +2 -8
  253. package/umd/Options/Classes/Particles/Move/OutModes.js +4 -5
  254. package/umd/Options/Classes/Particles/Move/Spin.js +3 -1
  255. package/umd/Options/Classes/Particles/Number/ParticlesDensity.js +2 -21
  256. package/umd/Options/Classes/Particles/Number/ParticlesNumber.js +2 -9
  257. package/umd/Options/Classes/Particles/Opacity/Opacity.js +10 -6
  258. package/umd/Options/Classes/Particles/Opacity/OpacityAnimation.js +0 -9
  259. package/umd/Options/Classes/Particles/ParticlesOptions.js +6 -11
  260. package/umd/Options/Classes/Particles/Shape/Shape.js +9 -10
  261. package/umd/Options/Classes/Particles/Size/Size.js +12 -8
  262. package/umd/Options/Classes/Particles/Size/SizeAnimation.js +0 -9
  263. package/umd/Options/Classes/ValueWithRandom.js +5 -18
  264. package/umd/Utils/CanvasUtils.js +21 -58
  265. package/umd/Utils/ColorUtils.js +16 -18
  266. package/umd/Utils/EventDispatcher.js +7 -6
  267. package/umd/Utils/HslColorManager.js +2 -4
  268. package/umd/Utils/NumberUtils.js +42 -46
  269. package/umd/Utils/RgbColorManager.js +2 -4
  270. package/umd/Utils/Utils.js +146 -66
  271. package/umd/bundle.js +5 -98
  272. package/umd/export-types.js +123 -0
  273. package/umd/exports.js +115 -0
  274. package/umd/index.js +9 -200
  275. package/umd/init.js +26 -0
  276. package/browser/Core/Utils/FrameManager.js +0 -42
  277. package/browser/Core/Utils/Plugins.js +0 -112
  278. package/browser/Options/Interfaces/Particles/Shape/IImageShape.js +0 -1
  279. package/browser/Options/Interfaces/Particles/Shape/IPolygonShape.js +0 -1
  280. package/browser/Options/Interfaces/Particles/Shape/IShapeValues.js +0 -1
  281. package/browser/Options/Interfaces/Particles/Shape/IStarShape.js +0 -1
  282. package/browser/engine.js +0 -175
  283. package/cjs/Core/Utils/FrameManager.js +0 -46
  284. package/cjs/Core/Utils/Plugins.js +0 -116
  285. package/cjs/Enums/Modes/SizeMode.js +0 -2
  286. package/cjs/Options/Interfaces/Particles/Shape/ICharacterShape.js +0 -2
  287. package/cjs/Options/Interfaces/Particles/Shape/IImageShape.js +0 -2
  288. package/cjs/Options/Interfaces/Particles/Shape/IPolygonShape.js +0 -2
  289. package/cjs/Options/Interfaces/Particles/Shape/IShapeValues.js +0 -17
  290. package/cjs/Options/Interfaces/Particles/Shape/IStarShape.js +0 -2
  291. package/cjs/engine.js +0 -179
  292. package/esm/Core/Interfaces/IParticleOverride.js +0 -1
  293. package/esm/Core/Interfaces/IParticlesMover.js +0 -1
  294. package/esm/Core/Utils/FrameManager.js +0 -42
  295. package/esm/Core/Utils/Plugins.js +0 -112
  296. package/esm/Enums/Modes/SizeMode.js +0 -1
  297. package/esm/Options/Interfaces/Particles/Shape/ICharacterShape.js +0 -1
  298. package/esm/Options/Interfaces/Particles/Shape/IImageShape.js +0 -1
  299. package/esm/Options/Interfaces/Particles/Shape/IPolygonShape.js +0 -1
  300. package/esm/Options/Interfaces/Particles/Shape/IShapeValues.js +0 -1
  301. package/esm/Options/Interfaces/Particles/Shape/IStarShape.js +0 -1
  302. package/esm/engine.js +0 -175
  303. package/types/Core/Interfaces/IParticleOverride.d.ts +0 -6
  304. package/types/Core/Interfaces/IParticlesMover.d.ts +0 -7
  305. package/types/Core/Utils/FrameManager.d.ts +0 -6
  306. package/types/Core/Utils/Plugins.d.ts +0 -51
  307. package/types/Options/Interfaces/Particles/Shape/ICharacterShape.d.ts +0 -8
  308. package/types/Options/Interfaces/Particles/Shape/IImageShape.d.ts +0 -8
  309. package/types/Options/Interfaces/Particles/Shape/IPolygonShape.d.ts +0 -5
  310. package/types/Options/Interfaces/Particles/Shape/IShapeValues.d.ts +0 -1
  311. package/types/Options/Interfaces/Particles/Shape/IStarShape.d.ts +0 -6
  312. package/types/engine.d.ts +0 -39
  313. package/umd/Core/Utils/FrameManager.js +0 -56
  314. package/umd/Core/Utils/Plugins.js +0 -126
  315. package/umd/Enums/Modes/SizeMode.js +0 -12
  316. package/umd/Options/Interfaces/Particles/Shape/ICharacterShape.js +0 -12
  317. package/umd/Options/Interfaces/Particles/Shape/IImageShape.js +0 -12
  318. package/umd/Options/Interfaces/Particles/Shape/IPolygonShape.js +0 -12
  319. package/umd/Options/Interfaces/Particles/Shape/IShapeValues.js +0 -27
  320. package/umd/Options/Interfaces/Particles/Shape/IStarShape.js +0 -12
  321. package/umd/engine.js +0 -189
  322. /package/browser/{Core/Interfaces/IParticleOverride.js → Enums/Modes/PixelMode.js} +0 -0
  323. /package/browser/{Core/Interfaces/IParticlesMover.js → Types/ExportResult.js} +0 -0
  324. /package/cjs/{Core/Interfaces/IParticleOverride.js → Enums/Modes/PixelMode.js} +0 -0
  325. /package/cjs/{Core/Interfaces/IParticlesMover.js → Types/ExportResult.js} +0 -0
  326. /package/{browser/Enums/Modes/SizeMode.js → esm/Enums/Modes/PixelMode.js} +0 -0
  327. /package/{browser/Options/Interfaces/Particles/Shape/ICharacterShape.js → esm/Types/ExportResult.js} +0 -0
  328. /package/umd/{Core/Interfaces/IParticleOverride.js → Enums/Modes/PixelMode.js} +0 -0
  329. /package/umd/{Core/Interfaces/IParticlesMover.js → Types/ExportResult.js} +0 -0
@@ -20,20 +20,7 @@
20
20
  y: 3000,
21
21
  };
22
22
  }
23
- get rotateX() {
24
- return this.rotate.x;
25
- }
26
- set rotateX(value) {
27
- this.rotate.x = value;
28
- }
29
- get rotateY() {
30
- return this.rotate.y;
31
- }
32
- set rotateY(value) {
33
- this.rotate.y = value;
34
- }
35
23
  load(data) {
36
- var _a, _b, _c, _d;
37
24
  if (!data) {
38
25
  return;
39
26
  }
@@ -43,13 +30,15 @@
43
30
  if (data.enable !== undefined) {
44
31
  this.enable = data.enable;
45
32
  }
46
- const rotateX = (_b = (_a = data.rotate) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : data.rotateX;
47
- if (rotateX !== undefined) {
48
- this.rotate.x = rotateX;
49
- }
50
- const rotateY = (_d = (_c = data.rotate) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : data.rotateY;
51
- if (rotateY !== undefined) {
52
- this.rotate.y = rotateY;
33
+ if (data.rotate) {
34
+ const rotateX = data.rotate.x;
35
+ if (rotateX !== undefined) {
36
+ this.rotate.x = rotateX;
37
+ }
38
+ const rotateY = data.rotate.y;
39
+ if (rotateY !== undefined) {
40
+ this.rotate.y = rotateY;
41
+ }
53
42
  }
54
43
  }
55
44
  }
@@ -17,12 +17,6 @@
17
17
  this.length = 10;
18
18
  this.fill = new MoveTrailFill_1.MoveTrailFill();
19
19
  }
20
- get fillColor() {
21
- return this.fill.color;
22
- }
23
- set fillColor(value) {
24
- this.fill.load({ color: value });
25
- }
26
20
  load(data) {
27
21
  if (!data) {
28
22
  return;
@@ -30,8 +24,8 @@
30
24
  if (data.enable !== undefined) {
31
25
  this.enable = data.enable;
32
26
  }
33
- if (data.fill !== undefined || data.fillColor !== undefined) {
34
- this.fill.load(data.fill || { color: data.fillColor });
27
+ if (data.fill !== undefined) {
28
+ this.fill.load(data.fill);
35
29
  }
36
30
  if (data.length !== undefined) {
37
31
  this.length = data.length;
@@ -15,17 +15,16 @@
15
15
  this.default = "out";
16
16
  }
17
17
  load(data) {
18
- var _a, _b, _c, _d;
19
18
  if (!data) {
20
19
  return;
21
20
  }
22
21
  if (data.default !== undefined) {
23
22
  this.default = data.default;
24
23
  }
25
- this.bottom = (_a = data.bottom) !== null && _a !== void 0 ? _a : data.default;
26
- this.left = (_b = data.left) !== null && _b !== void 0 ? _b : data.default;
27
- this.right = (_c = data.right) !== null && _c !== void 0 ? _c : data.default;
28
- this.top = (_d = data.top) !== null && _d !== void 0 ? _d : data.default;
24
+ this.bottom = data.bottom ?? data.default;
25
+ this.left = data.left ?? data.default;
26
+ this.right = data.right ?? data.default;
27
+ this.top = data.top ?? data.default;
29
28
  }
30
29
  }
31
30
  exports.OutModes = OutModes;
@@ -27,7 +27,9 @@
27
27
  if (data.enable !== undefined) {
28
28
  this.enable = data.enable;
29
29
  }
30
- this.position = data.position ? (0, Utils_1.deepExtend)({}, data.position) : undefined;
30
+ if (data.position) {
31
+ this.position = (0, Utils_1.deepExtend)({}, data.position);
32
+ }
31
33
  }
32
34
  }
33
35
  exports.Spin = Spin;
@@ -16,37 +16,18 @@
16
16
  this.width = 1920;
17
17
  this.height = 1080;
18
18
  }
19
- get area() {
20
- return this.width;
21
- }
22
- set area(value) {
23
- this.width = value;
24
- }
25
- get factor() {
26
- return this.height;
27
- }
28
- set factor(value) {
29
- this.height = value;
30
- }
31
- get value_area() {
32
- return this.area;
33
- }
34
- set value_area(value) {
35
- this.area = value;
36
- }
37
19
  load(data) {
38
- var _a, _b, _c;
39
20
  if (!data) {
40
21
  return;
41
22
  }
42
23
  if (data.enable !== undefined) {
43
24
  this.enable = data.enable;
44
25
  }
45
- const width = (_b = (_a = data.width) !== null && _a !== void 0 ? _a : data.area) !== null && _b !== void 0 ? _b : data.value_area;
26
+ const width = data.width;
46
27
  if (width !== undefined) {
47
28
  this.width = width;
48
29
  }
49
- const height = (_c = data.height) !== null && _c !== void 0 ? _c : data.factor;
30
+ const height = data.height;
50
31
  if (height !== undefined) {
51
32
  this.height = height;
52
33
  }
@@ -15,21 +15,14 @@
15
15
  constructor() {
16
16
  this.density = new ParticlesDensity_1.ParticlesDensity();
17
17
  this.limit = 0;
18
- this.value = 100;
19
- }
20
- get max() {
21
- return this.limit;
22
- }
23
- set max(value) {
24
- this.limit = value;
18
+ this.value = 0;
25
19
  }
26
20
  load(data) {
27
- var _a;
28
21
  if (!data) {
29
22
  return;
30
23
  }
31
24
  this.density.load(data.density);
32
- const limit = (_a = data.limit) !== null && _a !== void 0 ? _a : data.max;
25
+ const limit = data.limit;
33
26
  if (limit !== undefined) {
34
27
  this.limit = limit;
35
28
  }
@@ -12,18 +12,22 @@
12
12
  exports.Opacity = void 0;
13
13
  const OpacityAnimation_1 = require("./OpacityAnimation");
14
14
  const ValueWithRandom_1 = require("../../ValueWithRandom");
15
- class Opacity extends ValueWithRandom_1.RangedAnimationValueWithRandom {
15
+ class Opacity extends ValueWithRandom_1.ValueWithRandom {
16
16
  constructor() {
17
17
  super();
18
18
  this.animation = new OpacityAnimation_1.OpacityAnimation();
19
19
  this.random.minimumValue = 0.1;
20
20
  this.value = 1;
21
21
  }
22
- get anim() {
23
- return this.animation;
24
- }
25
- set anim(value) {
26
- this.animation = value;
22
+ load(data) {
23
+ if (!data) {
24
+ return;
25
+ }
26
+ super.load(data);
27
+ const animation = data.animation;
28
+ if (animation !== undefined) {
29
+ this.animation.load(animation);
30
+ }
27
31
  }
28
32
  }
29
33
  exports.Opacity = Opacity;
@@ -17,16 +17,7 @@
17
17
  this.destroy = "none";
18
18
  this.speed = 2;
19
19
  }
20
- get opacity_min() {
21
- return this.minimumValue;
22
- }
23
- set opacity_min(value) {
24
- this.minimumValue = value;
25
- }
26
20
  load(data) {
27
- if ((data === null || data === void 0 ? void 0 : data.opacity_min) !== undefined && data.minimumValue === undefined) {
28
- data.minimumValue = data.opacity_min;
29
- }
30
21
  super.load(data);
31
22
  if (!data) {
32
23
  return;
@@ -42,7 +42,6 @@
42
42
  this.zIndex = new ZIndex_1.ZIndex();
43
43
  }
44
44
  load(data) {
45
- var _a, _b, _c, _d;
46
45
  if (!data) {
47
46
  return;
48
47
  }
@@ -52,7 +51,7 @@
52
51
  for (const group in data.groups) {
53
52
  const item = data.groups[group];
54
53
  if (item !== undefined) {
55
- this.groups[group] = (0, Utils_1.deepExtend)((_a = this.groups[group]) !== null && _a !== void 0 ? _a : {}, item);
54
+ this.groups[group] = (0, Utils_1.deepExtend)(this.groups[group] ?? {}, item);
56
55
  }
57
56
  }
58
57
  }
@@ -66,24 +65,20 @@
66
65
  this.size.load(data.size);
67
66
  this.shadow.load(data.shadow);
68
67
  this.zIndex.load(data.zIndex);
69
- const collisions = (_c = (_b = data.move) === null || _b === void 0 ? void 0 : _b.collisions) !== null && _c !== void 0 ? _c : (_d = data.move) === null || _d === void 0 ? void 0 : _d.bounce;
70
- if (collisions !== undefined) {
71
- this.collisions.enable = collisions;
72
- }
73
68
  this.collisions.load(data.collisions);
74
69
  if (data.interactivity !== undefined) {
75
70
  this.interactivity = (0, Utils_1.deepExtend)({}, data.interactivity);
76
71
  }
77
- const stroke = data.stroke;
78
- if (stroke) {
79
- this.stroke = (0, Utils_1.executeOnSingleOrMultiple)(stroke, (t) => {
72
+ const strokeToLoad = data.stroke;
73
+ if (strokeToLoad) {
74
+ this.stroke = (0, Utils_1.executeOnSingleOrMultiple)(strokeToLoad, (t) => {
80
75
  const tmp = new Stroke_1.Stroke();
81
76
  tmp.load(t);
82
77
  return tmp;
83
78
  });
84
79
  }
85
80
  if (this._container) {
86
- const updaters = this._engine.plugins.updaters.get(this._container);
81
+ const updaters = this._engine.updaters.get(this._container);
87
82
  if (updaters) {
88
83
  for (const updater of updaters) {
89
84
  if (updater.loadOptions) {
@@ -91,7 +86,7 @@
91
86
  }
92
87
  }
93
88
  }
94
- const interactors = this._engine.plugins.interactors.get(this._container);
89
+ const interactors = this._engine.interactors.get(this._container);
95
90
  if (interactors) {
96
91
  for (const interactor of interactors) {
97
92
  if (interactor.loadParticlesOptions) {
@@ -13,31 +13,30 @@
13
13
  const Utils_1 = require("../../../../Utils/Utils");
14
14
  class Shape {
15
15
  constructor() {
16
- this.options = {};
17
- this.type = "circle";
18
16
  this.close = true;
19
17
  this.fill = true;
18
+ this.options = {};
19
+ this.type = "circle";
20
20
  }
21
21
  load(data) {
22
- var _a;
23
22
  if (!data) {
24
23
  return;
25
24
  }
26
- if (data.close !== undefined) {
27
- this.close = data.close;
28
- }
29
- if (data.fill !== undefined) {
30
- this.fill = data.fill;
31
- }
32
25
  const options = data.options;
33
26
  if (options !== undefined) {
34
27
  for (const shape in options) {
35
28
  const item = options[shape];
36
29
  if (item) {
37
- this.options[shape] = (0, Utils_1.deepExtend)((_a = this.options[shape]) !== null && _a !== void 0 ? _a : {}, item);
30
+ this.options[shape] = (0, Utils_1.deepExtend)(this.options[shape] ?? {}, item);
38
31
  }
39
32
  }
40
33
  }
34
+ if (data.close !== undefined) {
35
+ this.close = data.close;
36
+ }
37
+ if (data.fill !== undefined) {
38
+ this.fill = data.fill;
39
+ }
41
40
  if (data.type !== undefined) {
42
41
  this.type = data.type;
43
42
  }
@@ -4,26 +4,30 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "../../ValueWithRandom", "./SizeAnimation"], factory);
7
+ define(["require", "exports", "./SizeAnimation", "../../ValueWithRandom"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Size = void 0;
13
- const ValueWithRandom_1 = require("../../ValueWithRandom");
14
13
  const SizeAnimation_1 = require("./SizeAnimation");
15
- class Size extends ValueWithRandom_1.RangedAnimationValueWithRandom {
14
+ const ValueWithRandom_1 = require("../../ValueWithRandom");
15
+ class Size extends ValueWithRandom_1.ValueWithRandom {
16
16
  constructor() {
17
17
  super();
18
18
  this.animation = new SizeAnimation_1.SizeAnimation();
19
19
  this.random.minimumValue = 1;
20
20
  this.value = 3;
21
21
  }
22
- get anim() {
23
- return this.animation;
24
- }
25
- set anim(value) {
26
- this.animation = value;
22
+ load(data) {
23
+ super.load(data);
24
+ if (!data) {
25
+ return;
26
+ }
27
+ const animation = data.animation;
28
+ if (animation !== undefined) {
29
+ this.animation.load(animation);
30
+ }
27
31
  }
28
32
  }
29
33
  exports.Size = Size;
@@ -17,16 +17,7 @@
17
17
  this.destroy = "none";
18
18
  this.speed = 5;
19
19
  }
20
- get size_min() {
21
- return this.minimumValue;
22
- }
23
- set size_min(value) {
24
- this.minimumValue = value;
25
- }
26
20
  load(data) {
27
- if ((data === null || data === void 0 ? void 0 : data.size_min) !== undefined && data.minimumValue === undefined) {
28
- data.minimumValue = data.size_min;
29
- }
30
21
  super.load(data);
31
22
  if (!data) {
32
23
  return;
@@ -4,7 +4,7 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./AnimationOptions", "./Random", "./AnimationOptions", "../../Utils/NumberUtils"], factory);
7
+ define(["require", "exports", "./AnimationOptions", "./Random", "../../Utils/Utils", "../../Utils/NumberUtils"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
@@ -12,7 +12,7 @@
12
12
  exports.RangedAnimationValueWithRandom = exports.AnimationValueWithRandom = exports.ValueWithRandom = void 0;
13
13
  const AnimationOptions_1 = require("./AnimationOptions");
14
14
  const Random_1 = require("./Random");
15
- const AnimationOptions_2 = require("./AnimationOptions");
15
+ const Utils_1 = require("../../Utils/Utils");
16
16
  const NumberUtils_1 = require("../../Utils/NumberUtils");
17
17
  class ValueWithRandom {
18
18
  constructor() {
@@ -23,7 +23,7 @@
23
23
  if (!data) {
24
24
  return;
25
25
  }
26
- if (typeof data.random === "boolean") {
26
+ if ((0, Utils_1.isBoolean)(data.random)) {
27
27
  this.random.enable = data.random;
28
28
  }
29
29
  else {
@@ -40,19 +40,12 @@
40
40
  super();
41
41
  this.animation = new AnimationOptions_1.AnimationOptions();
42
42
  }
43
- get anim() {
44
- return this.animation;
45
- }
46
- set anim(value) {
47
- this.animation = value;
48
- }
49
43
  load(data) {
50
- var _a;
51
44
  super.load(data);
52
45
  if (!data) {
53
46
  return;
54
47
  }
55
- const animation = (_a = data.animation) !== null && _a !== void 0 ? _a : data.anim;
48
+ const animation = data.animation;
56
49
  if (animation !== undefined) {
57
50
  this.animation.load(animation);
58
51
  }
@@ -62,16 +55,10 @@
62
55
  class RangedAnimationValueWithRandom extends AnimationValueWithRandom {
63
56
  constructor() {
64
57
  super();
65
- this.animation = new AnimationOptions_2.RangedAnimationOptions();
58
+ this.animation = new AnimationOptions_1.RangedAnimationOptions();
66
59
  }
67
60
  load(data) {
68
61
  super.load(data);
69
- if (!data) {
70
- return;
71
- }
72
- if (data.animation !== undefined) {
73
- this.value = (0, NumberUtils_1.setRangeValue)(this.value, this.animation.enable ? this.animation.minimumValue : undefined);
74
- }
75
62
  }
76
63
  }
77
64
  exports.RangedAnimationValueWithRandom = RangedAnimationValueWithRandom;
@@ -9,58 +9,8 @@
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.alterHsl = exports.drawParticlePlugin = exports.drawPlugin = exports.drawShapeAfterEffect = exports.drawShape = exports.drawParticle = exports.clear = exports.drawTriangle = exports.drawLine = exports.paintCanvas = exports.clearCanvas = exports.getContext = void 0;
12
+ exports.alterHsl = exports.drawParticlePlugin = exports.drawPlugin = exports.drawShapeAfterEffect = exports.drawShape = exports.drawParticle = exports.clear = exports.paintImage = exports.paintBase = exports.drawTriangle = exports.drawLine = void 0;
13
13
  const ColorUtils_1 = require("./ColorUtils");
14
- function paintBase(context, dimension, baseColor) {
15
- context.fillStyle = baseColor !== null && baseColor !== void 0 ? baseColor : "rgba(0,0,0,0)";
16
- context.fillRect(0, 0, dimension.width, dimension.height);
17
- }
18
- function paintImage(context, dimension, image, opacity) {
19
- if (!image) {
20
- return;
21
- }
22
- context.globalAlpha = opacity;
23
- context.drawImage(image, 0, 0, dimension.width, dimension.height);
24
- context.globalAlpha = 1;
25
- }
26
- function getContext(canvas) {
27
- const context = canvas.getContext("2d");
28
- if (!context) {
29
- throw new Error("Error tsParticles - No canvas context found");
30
- }
31
- return context;
32
- }
33
- exports.getContext = getContext;
34
- function clearCanvas(context, size, options, trailFill, coverColorStyle) {
35
- if (options.backgroundMask.enable) {
36
- paintCanvas(context, size, options, coverColorStyle);
37
- }
38
- else {
39
- const trail = options.particles.move.trail;
40
- if (trail.enable && trail.length > 0 && trailFill) {
41
- if (trailFill.color) {
42
- paintBase(context, size, (0, ColorUtils_1.getStyleFromRgb)(trailFill.color, trailFill.opacity));
43
- }
44
- else if (trailFill.image) {
45
- paintImage(context, size, trailFill.image, trailFill.opacity);
46
- }
47
- }
48
- else {
49
- clear(context, size);
50
- }
51
- }
52
- }
53
- exports.clearCanvas = clearCanvas;
54
- function paintCanvas(context, size, options, coverColorStyle) {
55
- if (options.backgroundMask.enable && coverColorStyle) {
56
- clear(context, size);
57
- paintBase(context, size, coverColorStyle);
58
- }
59
- else {
60
- paintBase(context, size);
61
- }
62
- }
63
- exports.paintCanvas = paintCanvas;
64
14
  function drawLine(context, begin, end) {
65
15
  context.beginPath();
66
16
  context.moveTo(begin.x, begin.y);
@@ -76,21 +26,34 @@
76
26
  context.closePath();
77
27
  }
78
28
  exports.drawTriangle = drawTriangle;
29
+ function paintBase(context, dimension, baseColor) {
30
+ context.fillStyle = baseColor ?? "rgba(0,0,0,0)";
31
+ context.fillRect(0, 0, dimension.width, dimension.height);
32
+ }
33
+ exports.paintBase = paintBase;
34
+ function paintImage(context, dimension, image, opacity) {
35
+ if (!image) {
36
+ return;
37
+ }
38
+ context.globalAlpha = opacity;
39
+ context.drawImage(image, 0, 0, dimension.width, dimension.height);
40
+ context.globalAlpha = 1;
41
+ }
42
+ exports.paintImage = paintImage;
79
43
  function clear(context, dimension) {
80
44
  context.clearRect(0, 0, dimension.width, dimension.height);
81
45
  }
82
46
  exports.clear = clear;
83
47
  function drawParticle(data) {
84
- var _a, _b, _c, _d, _e;
85
48
  const { container, context, particle, delta, colorStyles, backgroundMask, composite, radius, opacity, shadow, transform, } = data;
86
49
  const pos = particle.getPosition(), angle = particle.rotation + (particle.pathRotation ? particle.velocity.angle : 0), rotateData = {
87
50
  sin: Math.sin(angle),
88
51
  cos: Math.cos(angle),
89
52
  }, transformData = {
90
- a: rotateData.cos * ((_a = transform.a) !== null && _a !== void 0 ? _a : 1),
91
- b: rotateData.sin * ((_b = transform.b) !== null && _b !== void 0 ? _b : 1),
92
- c: -rotateData.sin * ((_c = transform.c) !== null && _c !== void 0 ? _c : 1),
93
- d: rotateData.cos * ((_d = transform.d) !== null && _d !== void 0 ? _d : 1),
53
+ a: rotateData.cos * (transform.a ?? 1),
54
+ b: rotateData.sin * (transform.b ?? 1),
55
+ c: -rotateData.sin * (transform.c ?? 1),
56
+ d: rotateData.cos * (transform.d ?? 1),
94
57
  };
95
58
  context.setTransform(transformData.a, transformData.b, transformData.c, transformData.d, pos.x, pos.y);
96
59
  context.beginPath();
@@ -107,7 +70,7 @@
107
70
  if (colorStyles.fill) {
108
71
  context.fillStyle = colorStyles.fill;
109
72
  }
110
- const strokeWidth = (_e = particle.strokeWidth) !== null && _e !== void 0 ? _e : 0;
73
+ const strokeWidth = particle.strokeWidth ?? 0;
111
74
  context.lineWidth = strokeWidth;
112
75
  if (colorStyles.stroke) {
113
76
  context.strokeStyle = colorStyles.stroke;
@@ -143,7 +106,7 @@
143
106
  return;
144
107
  }
145
108
  const drawer = container.drawers.get(particle.shape);
146
- if (!(drawer === null || drawer === void 0 ? void 0 : drawer.afterEffect)) {
109
+ if (!drawer || !drawer.afterEffect) {
147
110
  return;
148
111
  }
149
112
  drawer.afterEffect(context, particle, radius, opacity, delta, container.retina.pixelRatio);
@@ -57,11 +57,11 @@
57
57
  if (!input) {
58
58
  return;
59
59
  }
60
- const color = typeof input === "string" ? { value: input } : input;
61
- if (typeof color.value === "string") {
60
+ const color = (0, Utils_1.isString)(input) ? { value: input } : input;
61
+ if ((0, Utils_1.isString)(color.value)) {
62
62
  return colorToRgb(color.value, index, useIndex);
63
63
  }
64
- if (color.value instanceof Array) {
64
+ if ((0, Utils_1.isArray)(color.value)) {
65
65
  return rangeColorToRgb({
66
66
  value: (0, Utils_1.itemFromArray)(color.value, index, useIndex),
67
67
  });
@@ -78,11 +78,11 @@
78
78
  if (!input) {
79
79
  return;
80
80
  }
81
- const color = typeof input === "string" ? { value: input } : input;
82
- if (typeof color.value === "string") {
81
+ const color = (0, Utils_1.isString)(input) ? { value: input } : input;
82
+ if ((0, Utils_1.isString)(color.value)) {
83
83
  return color.value === randomColorValue ? getRandomRgbColor() : stringToRgb(color.value);
84
84
  }
85
- if (color.value instanceof Array) {
85
+ if ((0, Utils_1.isArray)(color.value)) {
86
86
  return colorToRgb({
87
87
  value: (0, Utils_1.itemFromArray)(color.value, index, useIndex),
88
88
  });
@@ -131,8 +131,7 @@
131
131
  }
132
132
  exports.rgbToHsl = rgbToHsl;
133
133
  function stringToAlpha(input) {
134
- var _a;
135
- return (_a = stringToRgba(input)) === null || _a === void 0 ? void 0 : _a.a;
134
+ return stringToRgba(input)?.a;
136
135
  }
137
136
  exports.stringToAlpha = stringToAlpha;
138
137
  function stringToRgb(input) {
@@ -146,9 +145,7 @@
146
145
  s: hsl.s / 100,
147
146
  };
148
147
  if (!hslPercent.s) {
149
- result.b = hslPercent.l;
150
- result.g = hslPercent.l;
151
- result.r = hslPercent.l;
148
+ result.r = result.g = result.b = hslPercent.l;
152
149
  }
153
150
  else {
154
151
  const q = hslPercent.l < 0.5
@@ -175,7 +172,7 @@
175
172
  }
176
173
  exports.hslaToRgba = hslaToRgba;
177
174
  function getRandomRgbColor(min) {
178
- const fixedMin = min !== null && min !== void 0 ? min : 0;
175
+ const fixedMin = min ?? 0;
179
176
  return {
180
177
  b: Math.floor((0, NumberUtils_1.randomInRange)((0, NumberUtils_1.setRangeValue)(fixedMin, 256))),
181
178
  g: Math.floor((0, NumberUtils_1.randomInRange)((0, NumberUtils_1.setRangeValue)(fixedMin, 256))),
@@ -184,11 +181,11 @@
184
181
  }
185
182
  exports.getRandomRgbColor = getRandomRgbColor;
186
183
  function getStyleFromRgb(color, opacity) {
187
- return `rgba(${color.r}, ${color.g}, ${color.b}, ${opacity !== null && opacity !== void 0 ? opacity : 1})`;
184
+ return `rgba(${color.r}, ${color.g}, ${color.b}, ${opacity ?? 1})`;
188
185
  }
189
186
  exports.getStyleFromRgb = getStyleFromRgb;
190
187
  function getStyleFromHsl(color, opacity) {
191
- return `hsla(${color.h}, ${color.s}%, ${color.l}%, ${opacity !== null && opacity !== void 0 ? opacity : 1})`;
188
+ return `hsla(${color.h}, ${color.s}%, ${color.l}%, ${opacity ?? 1})`;
192
189
  }
193
190
  exports.getStyleFromHsl = getStyleFromHsl;
194
191
  function colorMix(color1, color2, size1, size2) {
@@ -207,17 +204,16 @@
207
204
  }
208
205
  exports.colorMix = colorMix;
209
206
  function getLinkColor(p1, p2, linkColor) {
210
- var _a, _b;
211
207
  if (linkColor === randomColorValue) {
212
208
  return getRandomRgbColor();
213
209
  }
214
210
  else if (linkColor === midColorValue) {
215
- const sourceColor = (_a = p1.getFillColor()) !== null && _a !== void 0 ? _a : p1.getStrokeColor(), destColor = (_b = p2 === null || p2 === void 0 ? void 0 : p2.getFillColor()) !== null && _b !== void 0 ? _b : p2 === null || p2 === void 0 ? void 0 : p2.getStrokeColor();
211
+ const sourceColor = p1.getFillColor() ?? p1.getStrokeColor(), destColor = p2?.getFillColor() ?? p2?.getStrokeColor();
216
212
  if (sourceColor && destColor && p2) {
217
213
  return colorMix(sourceColor, destColor, p1.getRadius(), p2.getRadius());
218
214
  }
219
215
  else {
220
- const hslColor = sourceColor !== null && sourceColor !== void 0 ? sourceColor : destColor;
216
+ const hslColor = sourceColor ?? destColor;
221
217
  if (hslColor) {
222
218
  return hslToRgb(hslColor);
223
219
  }
@@ -229,7 +225,7 @@
229
225
  }
230
226
  exports.getLinkColor = getLinkColor;
231
227
  function getLinkRandomColor(optColor, blink, consent) {
232
- const color = typeof optColor === "string" ? optColor : optColor.value;
228
+ const color = (0, Utils_1.isString)(optColor) ? optColor : optColor.value;
233
229
  if (color === randomColorValue) {
234
230
  if (consent) {
235
231
  return rangeColorToRgb({
@@ -292,6 +288,8 @@
292
288
  colorValue.status = "increasing";
293
289
  colorValue.loops = 0;
294
290
  colorValue.maxLoops = (0, NumberUtils_1.getRangeValue)(colorAnimation.count);
291
+ colorValue.time = 0;
292
+ colorValue.delayTime = (0, NumberUtils_1.getRangeValue)(colorAnimation.delay) * 1000;
295
293
  if (!colorAnimation.sync) {
296
294
  colorValue.velocity *= (0, NumberUtils_1.getRandom)();
297
295
  colorValue.value *= (0, NumberUtils_1.getRandom)();