laymur 0.23.0 → 0.25.1

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 (316) hide show
  1. package/README.md +1 -1
  2. package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.d.ts +1 -1
  3. package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.js +1 -0
  4. package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.d.ts +3 -3
  5. package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.js +14 -16
  6. package/dist/core/constraints/UIConstraint.d.ts +22 -2
  7. package/dist/core/constraints/UIConstraint.js +26 -3
  8. package/dist/core/constraints/UICustomConstraint.d.ts +4 -4
  9. package/dist/core/constraints/UICustomConstraint.js +15 -15
  10. package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.d.ts +1 -1
  11. package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.js +1 -0
  12. package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.d.ts +3 -3
  13. package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.js +11 -13
  14. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.d.ts +1 -1
  15. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.js +1 -3
  16. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.d.ts +3 -3
  17. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.js +30 -30
  18. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.d.ts +1 -1
  19. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.js +2 -4
  20. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.d.ts +3 -3
  21. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.js +40 -39
  22. package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.d.ts +1 -1
  23. package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.js +1 -0
  24. package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.d.ts +3 -3
  25. package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.js +13 -15
  26. package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.d.ts +3 -3
  27. package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.js +1 -0
  28. package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.d.ts +13 -7
  29. package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.js +37 -30
  30. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.d.ts +1 -1
  31. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.js +1 -3
  32. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.d.ts +3 -3
  33. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.js +30 -30
  34. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.d.ts +1 -1
  35. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.js +2 -4
  36. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.d.ts +3 -3
  37. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.js +40 -39
  38. package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.d.ts +1 -1
  39. package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.js +1 -0
  40. package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.d.ts +3 -3
  41. package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.js +13 -15
  42. package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.d.ts +1 -1
  43. package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.js +1 -0
  44. package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.d.ts +3 -3
  45. package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.js +11 -13
  46. package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.d.ts +3 -3
  47. package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.js +1 -3
  48. package/dist/core/constraints/builders/UIConstraint2DBuilder.d.ts +11 -11
  49. package/dist/core/constraints/builders/UIConstraint2DBuilder.js +10 -13
  50. package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.d.ts +1 -1
  51. package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.js +1 -3
  52. package/dist/core/constraints/builders/UICoverConstraintBuilder.d.ts +7 -7
  53. package/dist/core/constraints/builders/UICoverConstraintBuilder.js +10 -13
  54. package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.d.ts +1 -1
  55. package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.js +1 -3
  56. package/dist/core/constraints/builders/UIFitConstraintBuilder.d.ts +7 -7
  57. package/dist/core/constraints/builders/UIFitConstraintBuilder.js +10 -13
  58. package/dist/core/elements/UIAnchor/UIAnchor.Internal.js +3 -5
  59. package/dist/core/elements/UIAnchor/UIAnchor.d.ts +23 -5
  60. package/dist/core/elements/UIAnchor/UIAnchor.js +42 -8
  61. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.d.ts +2 -2
  62. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.js +4 -6
  63. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.d.ts +10 -10
  64. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.js +108 -111
  65. package/dist/core/elements/UIDummy/UIDummy.Internal.d.ts +4 -4
  66. package/dist/core/elements/UIDummy/UIDummy.Internal.js +5 -8
  67. package/dist/core/elements/UIDummy/UIDummy.d.ts +19 -11
  68. package/dist/core/elements/UIDummy/UIDummy.js +59 -42
  69. package/dist/core/elements/UIElement/UIElement.Internal.d.ts +5 -5
  70. package/dist/core/elements/UIElement/UIElement.Internal.js +9 -12
  71. package/dist/core/elements/UIElement/UIElement.d.ts +11 -11
  72. package/dist/core/elements/UIElement/UIElement.js +57 -60
  73. package/dist/core/elements/UIGraphics/UIGraphics.Internal.d.ts +3 -3
  74. package/dist/core/elements/UIGraphics/UIGraphics.Internal.js +4 -7
  75. package/dist/core/elements/UIGraphics/UIGraphics.d.ts +7 -7
  76. package/dist/core/elements/UIGraphics/UIGraphics.js +44 -47
  77. package/dist/core/elements/UIImage/UIImage.Internal.d.ts +2 -2
  78. package/dist/core/elements/UIImage/UIImage.Internal.js +1 -0
  79. package/dist/core/elements/UIImage/UIImage.d.ts +9 -9
  80. package/dist/core/elements/UIImage/UIImage.js +21 -24
  81. package/dist/core/elements/UINineSlice/UINineSlice.Internal.d.ts +3 -3
  82. package/dist/core/elements/UINineSlice/UINineSlice.Internal.js +3 -5
  83. package/dist/core/elements/UINineSlice/UINineSlice.d.ts +12 -12
  84. package/dist/core/elements/UINineSlice/UINineSlice.js +71 -73
  85. package/dist/core/elements/UIProgress/UIProgress.Internal.d.ts +3 -4
  86. package/dist/core/elements/UIProgress/UIProgress.Internal.js +1 -3
  87. package/dist/core/elements/UIProgress/UIProgress.d.ts +10 -10
  88. package/dist/core/elements/UIProgress/UIProgress.js +59 -62
  89. package/dist/core/elements/UIScene/UIScene.Internal.d.ts +3 -3
  90. package/dist/core/elements/UIScene/UIScene.Internal.js +11 -14
  91. package/dist/core/elements/UIScene/UIScene.d.ts +8 -8
  92. package/dist/core/elements/UIScene/UIScene.js +68 -69
  93. package/dist/core/elements/UIText/UIText.Bidi.d.ts +2 -2
  94. package/dist/core/elements/UIText/UIText.Bidi.js +3 -5
  95. package/dist/core/elements/UIText/UIText.Interfaces.d.ts +6 -2
  96. package/dist/core/elements/UIText/UIText.Interfaces.js +1 -0
  97. package/dist/core/elements/UIText/UIText.Internal.d.ts +4 -4
  98. package/dist/core/elements/UIText/UIText.Internal.js +5 -7
  99. package/dist/core/elements/UIText/UIText.Measuring.d.ts +14 -7
  100. package/dist/core/elements/UIText/UIText.Measuring.js +115 -55
  101. package/dist/core/elements/UIText/UIText.Rendering.d.ts +3 -3
  102. package/dist/core/elements/UIText/UIText.Rendering.js +6 -9
  103. package/dist/core/elements/UIText/UIText.d.ts +28 -14
  104. package/dist/core/elements/UIText/UIText.js +181 -141
  105. package/dist/core/index.d.ts +55 -54
  106. package/dist/core/index.js +53 -0
  107. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.d.ts +4 -4
  108. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.js +2 -5
  109. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.d.ts +4 -4
  110. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.js +43 -42
  111. package/dist/core/layers/UILayer/UILayer.Internal.d.ts +2 -2
  112. package/dist/core/layers/UILayer/UILayer.Internal.js +4 -7
  113. package/dist/core/layers/UILayer/UILayer.d.ts +19 -4
  114. package/dist/core/layers/UILayer/UILayer.js +125 -62
  115. package/dist/core/miscellaneous/UIBlendMode.js +1 -3
  116. package/dist/core/miscellaneous/UIExpression.js +16 -19
  117. package/dist/core/miscellaneous/UIMode.js +3 -5
  118. package/dist/core/miscellaneous/UIOrientation.js +2 -4
  119. package/dist/core/miscellaneous/UIPriority.js +5 -8
  120. package/dist/core/miscellaneous/UIRelation.js +5 -8
  121. package/dist/core/miscellaneous/UITransparencyMode.js +1 -3
  122. package/dist/core/miscellaneous/area/UIArea.js +1 -3
  123. package/dist/core/miscellaneous/area/UIAreaCircle.d.ts +1 -1
  124. package/dist/core/miscellaneous/area/UIAreaCircle.js +3 -6
  125. package/dist/core/miscellaneous/area/UIAreaPolygon.d.ts +2 -2
  126. package/dist/core/miscellaneous/area/UIAreaPolygon.js +3 -6
  127. package/dist/core/miscellaneous/area/UIAreaRectangle.d.ts +1 -1
  128. package/dist/core/miscellaneous/area/UIAreaRectangle.js +3 -6
  129. package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.d.ts +1 -1
  130. package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.js +3 -6
  131. package/dist/core/miscellaneous/asserts.d.ts +30 -1
  132. package/dist/core/miscellaneous/asserts.js +87 -19
  133. package/dist/core/miscellaneous/canvas.js +13 -7
  134. package/dist/core/miscellaneous/color/UIColor.Internal.d.ts +1 -1
  135. package/dist/core/miscellaneous/color/UIColor.Internal.js +1 -3
  136. package/dist/core/miscellaneous/color/UIColor.d.ts +1 -1
  137. package/dist/core/miscellaneous/color/UIColor.js +202 -205
  138. package/dist/core/miscellaneous/computeTransform.d.ts +1 -1
  139. package/dist/core/miscellaneous/computeTransform.js +4 -7
  140. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.d.ts +10 -5
  141. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.js +63 -58
  142. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Layout.d.ts +52 -0
  143. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Layout.js +110 -0
  144. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.js +181 -261
  145. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.d.ts +3 -3
  146. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.js +1 -0
  147. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.js +209 -115
  148. package/dist/core/miscellaneous/generic-plane/shared.d.ts +12 -12
  149. package/dist/core/miscellaneous/generic-plane/shared.js +28 -23
  150. package/dist/core/miscellaneous/insets/UIInsets.Internal.js +1 -3
  151. package/dist/core/miscellaneous/insets/UIInsets.d.ts +1 -1
  152. package/dist/core/miscellaneous/insets/UIInsets.js +96 -99
  153. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.js +1 -3
  154. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.d.ts +1 -1
  155. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.js +14 -17
  156. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.d.ts +2 -2
  157. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.js +13 -16
  158. package/dist/core/miscellaneous/math.js +3 -5
  159. package/dist/core/miscellaneous/micro/UIMicro.Internal.js +6 -8
  160. package/dist/core/miscellaneous/micro/UIMicro.d.ts +1 -1
  161. package/dist/core/miscellaneous/micro/UIMicro.js +91 -94
  162. package/dist/core/miscellaneous/resize-policy/UIResizePolicy.js +1 -3
  163. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.d.ts +1 -1
  164. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.js +12 -15
  165. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.d.ts +1 -1
  166. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.js +13 -16
  167. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.d.ts +1 -1
  168. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.js +13 -16
  169. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.d.ts +1 -1
  170. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.js +12 -15
  171. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.d.ts +1 -1
  172. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.js +13 -16
  173. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.d.ts +1 -1
  174. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.js +13 -16
  175. package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.d.ts +1 -1
  176. package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.js +3 -6
  177. package/dist/core/miscellaneous/shared.d.ts +1 -1
  178. package/dist/core/miscellaneous/shared.js +4 -7
  179. package/dist/core/miscellaneous/text-span/UITextSpan.Internal.d.ts +1 -1
  180. package/dist/core/miscellaneous/text-span/UITextSpan.Internal.js +1 -0
  181. package/dist/core/miscellaneous/text-span/UITextSpan.d.ts +2 -2
  182. package/dist/core/miscellaneous/text-span/UITextSpan.js +10 -13
  183. package/dist/core/miscellaneous/text-style/UITextStyle.Internal.js +15 -17
  184. package/dist/core/miscellaneous/text-style/UITextStyle.d.ts +13 -2
  185. package/dist/core/miscellaneous/text-style/UITextStyle.js +222 -207
  186. package/dist/core/miscellaneous/texture/UITextureView.Internal.d.ts +7 -0
  187. package/dist/core/miscellaneous/texture/UITextureView.Internal.js +16 -6
  188. package/dist/core/miscellaneous/texture/UITextureView.d.ts +1 -1
  189. package/dist/core/miscellaneous/texture/UITextureView.js +113 -117
  190. package/dist/core/miscellaneous/webglCapabilities.js +3 -4
  191. package/dist/core/shaders/UIImage.d.ts +9 -0
  192. package/dist/core/shaders/UIImage.js +14 -0
  193. package/dist/core/shaders/UINineSlice.d.ts +11 -0
  194. package/dist/core/shaders/UINineSlice.js +57 -0
  195. package/dist/core/shaders/UIProgress.d.ts +14 -0
  196. package/dist/core/shaders/UIProgress.js +21 -0
  197. package/dist/core/shaders/UIProgressMaskFunctionCircular.d.ts +2 -0
  198. package/dist/core/shaders/UIProgressMaskFunctionCircular.js +16 -0
  199. package/dist/core/shaders/UIProgressMaskFunctionDirectional.d.ts +2 -0
  200. package/dist/core/shaders/UIProgressMaskFunctionDirectional.js +15 -0
  201. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.d.ts +4 -0
  202. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.js +1 -0
  203. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.d.ts +7 -1
  204. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.js +50 -47
  205. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.d.ts +5 -2
  206. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.js +1 -0
  207. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.d.ts +11 -3
  208. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.js +42 -26
  209. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.d.ts +5 -3
  210. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.js +1 -0
  211. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.d.ts +20 -4
  212. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.js +138 -117
  213. package/dist/debug/UIAspectDebug.d.ts +3 -3
  214. package/dist/debug/UIAspectDebug.js +64 -68
  215. package/dist/debug/UIConstraintDebug.d.ts +1 -1
  216. package/dist/debug/UIConstraintDebug.js +1 -0
  217. package/dist/debug/UIHeightDebug.d.ts +3 -3
  218. package/dist/debug/UIHeightDebug.js +63 -67
  219. package/dist/debug/UIHorizontalDistanceDebug.d.ts +3 -3
  220. package/dist/debug/UIHorizontalDistanceDebug.js +76 -81
  221. package/dist/debug/UIHorizontalInterpolationDebug.d.ts +3 -3
  222. package/dist/debug/UIHorizontalInterpolationDebug.js +74 -78
  223. package/dist/debug/UILayerDebug.d.ts +1 -1
  224. package/dist/debug/UILayerDebug.js +55 -64
  225. package/dist/debug/UIVerticalDistanceDebug.d.ts +3 -3
  226. package/dist/debug/UIVerticalDistanceDebug.js +76 -81
  227. package/dist/debug/UIVerticalInterpolationDebug.d.ts +3 -3
  228. package/dist/debug/UIVerticalInterpolationDebug.js +74 -78
  229. package/dist/debug/UIWidthDebug.d.ts +3 -3
  230. package/dist/debug/UIWidthDebug.js +63 -67
  231. package/dist/debug/index.d.ts +8 -8
  232. package/dist/debug/index.js +8 -8
  233. package/dist/debug/miscellaneous.js +8 -11
  234. package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.d.ts +3 -3
  235. package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.js +13 -16
  236. package/dist/particles/behaviorModules/UIBehaviorModule.d.ts +1 -1
  237. package/dist/particles/behaviorModules/UIBehaviorModule.js +1 -3
  238. package/dist/particles/behaviorModules/UIBehaviorPointGravity.d.ts +3 -3
  239. package/dist/particles/behaviorModules/UIBehaviorPointGravity.js +37 -40
  240. package/dist/particles/behaviorModules/UIBehaviorScaleOscillation.d.ts +41 -0
  241. package/dist/particles/behaviorModules/UIBehaviorScaleOscillation.js +87 -0
  242. package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.d.ts +2 -2
  243. package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.js +17 -20
  244. package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.d.ts +2 -2
  245. package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.js +13 -16
  246. package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.d.ts +2 -2
  247. package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.js +21 -24
  248. package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.d.ts +2 -2
  249. package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.js +13 -16
  250. package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.d.ts +2 -2
  251. package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.js +21 -24
  252. package/dist/particles/elements/UIEmitter.Internal.d.ts +2 -2
  253. package/dist/particles/elements/UIEmitter.Internal.js +6 -9
  254. package/dist/particles/elements/UIEmitter.d.ts +17 -11
  255. package/dist/particles/elements/UIEmitter.js +100 -88
  256. package/dist/particles/index.d.ts +20 -18
  257. package/dist/particles/index.js +19 -18
  258. package/dist/particles/instancedParticle/UIInstancedParticle.Internal.d.ts +1 -1
  259. package/dist/particles/instancedParticle/UIInstancedParticle.Internal.js +14 -15
  260. package/dist/particles/instancedParticle/UIInstancedParticle.d.ts +4 -1
  261. package/dist/particles/instancedParticle/UIInstancedParticle.js +40 -32
  262. package/dist/particles/miscellaneous/miscellaneous.d.ts +3 -3
  263. package/dist/particles/miscellaneous/miscellaneous.js +26 -27
  264. package/dist/particles/renderingModules/UIRenderingColorOverLife.d.ts +2 -2
  265. package/dist/particles/renderingModules/UIRenderingColorOverLife.js +5 -8
  266. package/dist/particles/renderingModules/UIRenderingColorOverVelocity.d.ts +2 -2
  267. package/dist/particles/renderingModules/UIRenderingColorOverVelocity.js +6 -9
  268. package/dist/particles/renderingModules/UIRenderingModule.js +1 -3
  269. package/dist/particles/renderingModules/UIRenderingTexture.d.ts +2 -2
  270. package/dist/particles/renderingModules/UIRenderingTexture.js +4 -7
  271. package/dist/particles/shaders/UIRenderingColorOverLife.d.ts +2 -0
  272. package/dist/particles/shaders/UIRenderingColorOverLife.js +7 -0
  273. package/dist/particles/shaders/UIRenderingColorOverVelocity.d.ts +9 -0
  274. package/dist/particles/shaders/UIRenderingColorOverVelocity.js +16 -0
  275. package/dist/particles/shaders/UIRenderingTexture.d.ts +2 -0
  276. package/dist/particles/shaders/UIRenderingTexture.js +7 -0
  277. package/dist/particles/spawnModules/UISpawnModule.d.ts +1 -1
  278. package/dist/particles/spawnModules/UISpawnModule.js +1 -3
  279. package/dist/particles/spawnModules/UISpawnOffset.d.ts +3 -3
  280. package/dist/particles/spawnModules/UISpawnOffset.js +12 -15
  281. package/dist/particles/spawnModules/UISpawnRandomLifetime.d.ts +2 -2
  282. package/dist/particles/spawnModules/UISpawnRandomLifetime.js +13 -16
  283. package/dist/particles/spawnModules/UISpawnRandomRotation.d.ts +2 -2
  284. package/dist/particles/spawnModules/UISpawnRandomRotation.js +13 -16
  285. package/dist/particles/spawnModules/UISpawnRandomScale.d.ts +2 -2
  286. package/dist/particles/spawnModules/UISpawnRandomScale.js +19 -22
  287. package/dist/particles/spawnModules/UISpawnRandomTorque.d.ts +2 -2
  288. package/dist/particles/spawnModules/UISpawnRandomTorque.js +13 -16
  289. package/dist/particles/spawnModules/UISpawnRandomVelocity.d.ts +2 -2
  290. package/dist/particles/spawnModules/UISpawnRandomVelocity.js +21 -24
  291. package/dist/particles/spawnModules/UISpawnRectangle.d.ts +3 -3
  292. package/dist/particles/spawnModules/UISpawnRectangle.js +21 -24
  293. package/package.json +13 -17
  294. package/dist/_virtual/2d.js +0 -3
  295. package/dist/_virtual/3d.js +0 -3
  296. package/dist/_virtual/4d.js +0 -3
  297. package/dist/_virtual/mod.js +0 -5
  298. package/dist/_virtual/mod2.js +0 -3
  299. package/dist/core/shaders/UIImage.glsl.js +0 -3
  300. package/dist/core/shaders/UINineSlice.glsl.js +0 -3
  301. package/dist/core/shaders/UIProgress.glsl.js +0 -3
  302. package/dist/core/shaders/UIProgressMaskFunctionCircular.glsl.js +0 -3
  303. package/dist/core/shaders/UIProgressMaskFunctionDirectional.glsl.js +0 -3
  304. package/dist/index.js +0 -52
  305. package/dist/node_modules/fast-simplex-noise/lib/2d.js +0 -93
  306. package/dist/node_modules/fast-simplex-noise/lib/3d.js +0 -142
  307. package/dist/node_modules/fast-simplex-noise/lib/4d.js +0 -196
  308. package/dist/node_modules/fast-simplex-noise/lib/mod.js +0 -24
  309. package/dist/node_modules/three/examples/jsm/lines/Line2.js +0 -56
  310. package/dist/node_modules/three/examples/jsm/lines/LineGeometry.js +0 -157
  311. package/dist/node_modules/three/examples/jsm/lines/LineMaterial.js +0 -691
  312. package/dist/node_modules/three/examples/jsm/lines/LineSegments2.js +0 -415
  313. package/dist/node_modules/three/examples/jsm/lines/LineSegmentsGeometry.js +0 -289
  314. package/dist/particles/shaders/UIRenderingColorOverLife.glsl.js +0 -3
  315. package/dist/particles/shaders/UIRenderingColorOverVelocity.glsl.js +0 -3
  316. package/dist/particles/shaders/UIRenderingTexture.glsl.js +0 -3
@@ -1,21 +1,20 @@
1
- import { MathUtils, Color, Vector4 } from 'three';
2
- import { assertValidNumber } from '../asserts.js';
3
- import { srgbToLinear, linearToSRGB } from '../math.js';
4
- import { COLORS } from './UIColor.Internal.js';
5
-
1
+ import { Color, MathUtils, Vector4 } from "three";
2
+ import { assertValidNumber } from "../asserts.js";
3
+ import { linearToSRGB, srgbToLinear } from "../math.js";
4
+ import { COLORS } from "./UIColor.Internal.js";
6
5
  /** RGBA color with RGB, HSL, hex, and named color support */
7
- class UIColor {
6
+ export class UIColor {
8
7
  constructor(...args) {
9
- this._private_rInternal = 1;
10
- this._private_gInternal = 1;
11
- this._private_bInternal = 1;
12
- this._private_aInternal = 1;
13
- this._private_hInternal = 0;
14
- this._private_sInternal = 0;
15
- this._private_lInternal = 1;
16
- this._private_dirtyInternal = false;
17
- this._private_rgbDirty = false;
18
- this._private_hslDirty = false;
8
+ this.rInternal = 1;
9
+ this.gInternal = 1;
10
+ this.bInternal = 1;
11
+ this.aInternal = 1;
12
+ this.hInternal = 0;
13
+ this.sInternal = 0;
14
+ this.lInternal = 1;
15
+ this.dirtyInternal = false;
16
+ this.rgbDirty = false;
17
+ this.hslDirty = false;
19
18
  if (args.length > 0) {
20
19
  this.set(...args);
21
20
  }
@@ -174,120 +173,120 @@ class UIColor {
174
173
  }
175
174
  /** Red component (0 to 1) */
176
175
  get r() {
177
- this._private_ensureRGBUpdatedFromHSL();
178
- return this._private_rInternal;
176
+ this.ensureRGBUpdatedFromHSL();
177
+ return this.rInternal;
179
178
  }
180
179
  /** Green component (0 to 1) */
181
180
  get g() {
182
- this._private_ensureRGBUpdatedFromHSL();
183
- return this._private_gInternal;
181
+ this.ensureRGBUpdatedFromHSL();
182
+ return this.gInternal;
184
183
  }
185
184
  /** Blue component (0 to 1) */
186
185
  get b() {
187
- this._private_ensureRGBUpdatedFromHSL();
188
- return this._private_bInternal;
186
+ this.ensureRGBUpdatedFromHSL();
187
+ return this.bInternal;
189
188
  }
190
189
  /** Alpha component (0 to 1) */
191
190
  get a() {
192
- return this._private_aInternal;
191
+ return this.aInternal;
193
192
  }
194
193
  /** Hue component (0 to 360) */
195
194
  get hue() {
196
- this._private_ensureHSLUpdatedFromRGB();
197
- return this._private_hInternal;
195
+ this.ensureHSLUpdatedFromRGB();
196
+ return this.hInternal;
198
197
  }
199
198
  /** Saturation component (0 to 1) */
200
199
  get saturation() {
201
- this._private_ensureHSLUpdatedFromRGB();
202
- return this._private_sInternal;
200
+ this.ensureHSLUpdatedFromRGB();
201
+ return this.sInternal;
203
202
  }
204
203
  /** Lightness component (0 to 1) */
205
204
  get lightness() {
206
- this._private_ensureHSLUpdatedFromRGB();
207
- return this._private_lInternal;
205
+ this.ensureHSLUpdatedFromRGB();
206
+ return this.lInternal;
208
207
  }
209
208
  /** @internal */
210
209
  get dirty() {
211
- return this._private_dirtyInternal;
210
+ return this.dirtyInternal;
212
211
  }
213
212
  /** Red component (0 to 1) */
214
213
  set r(value) {
215
214
  assertValidNumber(value, "UIColor.r");
216
215
  value = MathUtils.clamp(value, 0, 1);
217
- this._private_ensureRGBUpdatedFromHSL();
218
- if (value !== this._private_rInternal) {
219
- this._private_rInternal = value;
220
- this._private_hslDirty = true;
221
- this._private_dirtyInternal = true;
216
+ this.ensureRGBUpdatedFromHSL();
217
+ if (value !== this.rInternal) {
218
+ this.rInternal = value;
219
+ this.hslDirty = true;
220
+ this.dirtyInternal = true;
222
221
  }
223
222
  }
224
223
  /** Green component (0 to 1) */
225
224
  set g(value) {
226
225
  assertValidNumber(value, "UIColor.g");
227
226
  value = MathUtils.clamp(value, 0, 1);
228
- this._private_ensureRGBUpdatedFromHSL();
229
- if (value !== this._private_gInternal) {
230
- this._private_gInternal = value;
231
- this._private_hslDirty = true;
232
- this._private_dirtyInternal = true;
227
+ this.ensureRGBUpdatedFromHSL();
228
+ if (value !== this.gInternal) {
229
+ this.gInternal = value;
230
+ this.hslDirty = true;
231
+ this.dirtyInternal = true;
233
232
  }
234
233
  }
235
234
  /** Blue component (0 to 1) */
236
235
  set b(value) {
237
236
  assertValidNumber(value, "UIColor.b");
238
237
  value = MathUtils.clamp(value, 0, 1);
239
- this._private_ensureRGBUpdatedFromHSL();
240
- if (value !== this._private_bInternal) {
241
- this._private_bInternal = value;
242
- this._private_hslDirty = true;
243
- this._private_dirtyInternal = true;
238
+ this.ensureRGBUpdatedFromHSL();
239
+ if (value !== this.bInternal) {
240
+ this.bInternal = value;
241
+ this.hslDirty = true;
242
+ this.dirtyInternal = true;
244
243
  }
245
244
  }
246
245
  /** Alpha component (0 to 1) */
247
246
  set a(value) {
248
247
  assertValidNumber(value, "UIColor.a");
249
248
  value = MathUtils.clamp(value, 0, 1);
250
- if (value !== this._private_aInternal) {
251
- this._private_aInternal = value;
252
- this._private_dirtyInternal = true;
249
+ if (value !== this.aInternal) {
250
+ this.aInternal = value;
251
+ this.dirtyInternal = true;
253
252
  }
254
253
  }
255
254
  /** Hue component (0 to 360) */
256
255
  set hue(value) {
257
256
  assertValidNumber(value, "UIColor.hue");
258
257
  value = MathUtils.clamp(value, 0, 360);
259
- this._private_ensureHSLUpdatedFromRGB();
260
- if (value !== this._private_hInternal) {
261
- this._private_hInternal = value;
262
- this._private_rgbDirty = true;
263
- this._private_dirtyInternal = true;
258
+ this.ensureHSLUpdatedFromRGB();
259
+ if (value !== this.hInternal) {
260
+ this.hInternal = value;
261
+ this.rgbDirty = true;
262
+ this.dirtyInternal = true;
264
263
  }
265
264
  }
266
265
  /** Saturation component (0 to 1) */
267
266
  set saturation(value) {
268
267
  assertValidNumber(value, "UIColor.saturation");
269
268
  value = MathUtils.clamp(value, 0, 1);
270
- this._private_ensureHSLUpdatedFromRGB();
271
- if (value !== this._private_sInternal) {
272
- this._private_sInternal = value;
273
- this._private_rgbDirty = true;
274
- this._private_dirtyInternal = true;
269
+ this.ensureHSLUpdatedFromRGB();
270
+ if (value !== this.sInternal) {
271
+ this.sInternal = value;
272
+ this.rgbDirty = true;
273
+ this.dirtyInternal = true;
275
274
  }
276
275
  }
277
276
  /** Lightness component (0 to 1) */
278
277
  set lightness(value) {
279
278
  assertValidNumber(value, "UIColor.lightness");
280
279
  value = MathUtils.clamp(value, 0, 1);
281
- this._private_ensureHSLUpdatedFromRGB();
282
- if (value !== this._private_lInternal) {
283
- this._private_lInternal = value;
284
- this._private_rgbDirty = true;
285
- this._private_dirtyInternal = true;
280
+ this.ensureHSLUpdatedFromRGB();
281
+ if (value !== this.lInternal) {
282
+ this.lInternal = value;
283
+ this.rgbDirty = true;
284
+ this.dirtyInternal = true;
286
285
  }
287
286
  }
288
287
  /** @internal */
289
288
  setDirtyFalse() {
290
- this._private_dirtyInternal = false;
289
+ this.dirtyInternal = false;
291
290
  }
292
291
  set(...args) {
293
292
  if (args.length === 0 || args[0] === undefined) {
@@ -315,7 +314,7 @@ class UIColor {
315
314
  throw new Error("UIColor.set: cannot create color from provided arguments");
316
315
  }
317
316
  /** Sets RGBA components directly */
318
- setRGBA(r, g, b, a = this._private_aInternal) {
317
+ setRGBA(r, g, b, a = this.aInternal) {
319
318
  assertValidNumber(r, "UIColor.setRGBA.r");
320
319
  assertValidNumber(g, "UIColor.setRGBA.g");
321
320
  assertValidNumber(b, "UIColor.setRGBA.b");
@@ -324,34 +323,34 @@ class UIColor {
324
323
  g = MathUtils.clamp(g, 0, 1);
325
324
  b = MathUtils.clamp(b, 0, 1);
326
325
  a = MathUtils.clamp(a, 0, 1);
327
- this._private_ensureRGBUpdatedFromHSL();
328
- if (r !== this._private_rInternal ||
329
- g !== this._private_gInternal ||
330
- b !== this._private_bInternal ||
331
- a !== this._private_aInternal) {
332
- this._private_rInternal = r;
333
- this._private_gInternal = g;
334
- this._private_bInternal = b;
335
- this._private_aInternal = a;
336
- this._private_hslDirty = true;
337
- this._private_dirtyInternal = true;
326
+ this.ensureRGBUpdatedFromHSL();
327
+ if (r !== this.rInternal ||
328
+ g !== this.gInternal ||
329
+ b !== this.bInternal ||
330
+ a !== this.aInternal) {
331
+ this.rInternal = r;
332
+ this.gInternal = g;
333
+ this.bInternal = b;
334
+ this.aInternal = a;
335
+ this.hslDirty = true;
336
+ this.dirtyInternal = true;
338
337
  }
339
338
  return this;
340
339
  }
341
340
  /** Returns RGBA as 32-bit hex (RRGGBBAA) */
342
341
  getHexRGBA() {
343
- this._private_ensureRGBUpdatedFromHSL();
344
- return ((Math.round(this._private_rInternal * 255) << 24) |
345
- (Math.round(this._private_gInternal * 255) << 16) |
346
- (Math.round(this._private_bInternal * 255) << 8) |
347
- Math.round(this._private_aInternal * 255));
342
+ this.ensureRGBUpdatedFromHSL();
343
+ return ((Math.round(this.rInternal * 255) << 24) |
344
+ (Math.round(this.gInternal * 255) << 16) |
345
+ (Math.round(this.bInternal * 255) << 8) |
346
+ Math.round(this.aInternal * 255));
348
347
  }
349
348
  /** Returns RGB as 24-bit hex (RRGGBB) */
350
349
  getHexRGB() {
351
- this._private_ensureRGBUpdatedFromHSL();
352
- return ((Math.round(this._private_rInternal * 255) << 16) |
353
- (Math.round(this._private_gInternal * 255) << 8) |
354
- Math.round(this._private_bInternal * 255));
350
+ this.ensureRGBUpdatedFromHSL();
351
+ return ((Math.round(this.rInternal * 255) << 16) |
352
+ (Math.round(this.gInternal * 255) << 8) |
353
+ Math.round(this.bInternal * 255));
355
354
  }
356
355
  /** Returns RGB as hex string ("#ffffff") */
357
356
  getHexStringRGB() {
@@ -366,43 +365,43 @@ class UIColor {
366
365
  /** Sets from 32-bit hex RGBA (RRGGBBAA) */
367
366
  setHexRGBA(hex) {
368
367
  assertValidNumber(hex, "UIColor.setHexRGBA.hex");
369
- this._private_ensureRGBUpdatedFromHSL();
368
+ this.ensureRGBUpdatedFromHSL();
370
369
  const r = ((hex >> 24) & 0xff) / 255;
371
370
  const g = ((hex >> 16) & 0xff) / 255;
372
371
  const b = ((hex >> 8) & 0xff) / 255;
373
372
  const a = (hex & 0xff) / 255;
374
- if (r !== this._private_rInternal ||
375
- g !== this._private_gInternal ||
376
- b !== this._private_bInternal ||
377
- a !== this._private_aInternal) {
378
- this._private_rInternal = r;
379
- this._private_gInternal = g;
380
- this._private_bInternal = b;
381
- this._private_aInternal = a;
382
- this._private_hslDirty = true;
383
- this._private_dirtyInternal = true;
373
+ if (r !== this.rInternal ||
374
+ g !== this.gInternal ||
375
+ b !== this.bInternal ||
376
+ a !== this.aInternal) {
377
+ this.rInternal = r;
378
+ this.gInternal = g;
379
+ this.bInternal = b;
380
+ this.aInternal = a;
381
+ this.hslDirty = true;
382
+ this.dirtyInternal = true;
384
383
  }
385
384
  return this;
386
385
  }
387
386
  /** Sets from 24-bit hex RGB (RRGGBB) */
388
- setHexRGB(hex, a = this._private_aInternal) {
387
+ setHexRGB(hex, a = this.aInternal) {
389
388
  assertValidNumber(hex, "UIColor.setHexRGB.hex");
390
389
  assertValidNumber(a, "UIColor.setHexRGB.a");
391
390
  a = MathUtils.clamp(a, 0, 1);
392
- this._private_ensureRGBUpdatedFromHSL();
391
+ this.ensureRGBUpdatedFromHSL();
393
392
  const r = ((hex >> 16) & 0xff) / 255;
394
393
  const g = ((hex >> 8) & 0xff) / 255;
395
394
  const b = (hex & 0xff) / 255;
396
- if (r !== this._private_rInternal ||
397
- g !== this._private_gInternal ||
398
- b !== this._private_bInternal ||
399
- a !== this._private_aInternal) {
400
- this._private_rInternal = r;
401
- this._private_gInternal = g;
402
- this._private_bInternal = b;
403
- this._private_aInternal = a;
404
- this._private_hslDirty = true;
405
- this._private_dirtyInternal = true;
395
+ if (r !== this.rInternal ||
396
+ g !== this.gInternal ||
397
+ b !== this.bInternal ||
398
+ a !== this.aInternal) {
399
+ this.rInternal = r;
400
+ this.gInternal = g;
401
+ this.bInternal = b;
402
+ this.aInternal = a;
403
+ this.hslDirty = true;
404
+ this.dirtyInternal = true;
406
405
  }
407
406
  return this;
408
407
  }
@@ -414,29 +413,29 @@ class UIColor {
414
413
  */
415
414
  setHexString(hexString) {
416
415
  if (!hexString.startsWith("#")) {
417
- throw new Error(`UIColor.setHexString.hexString: invalid hex string format. expected format: "#ffffff" or "#ffffffff"`);
416
+ throw new Error(`UIColor.setHexString.hexString: invalid hex string "${hexString}", expected "#ffffff" or "#ffffffff"`);
418
417
  }
419
418
  const hex = hexString.slice(1);
420
419
  if (hex.length === 6) {
421
420
  const hexNumber = parseInt(hex, 16);
422
421
  if (isNaN(hexNumber)) {
423
- throw new Error(`UIColor.setHexString.hexString: invalid hex string format. expected format: "#ffffff" or "#ffffffff"`);
422
+ throw new Error(`UIColor.setHexString.hexString: invalid hex string "${hexString}", expected "#ffffff" or "#ffffffff"`);
424
423
  }
425
424
  return this.setHexRGB(hexNumber);
426
425
  }
427
426
  else if (hex.length === 8) {
428
427
  const hexNumber = parseInt(hex, 16);
429
428
  if (isNaN(hexNumber)) {
430
- throw new Error(`UIColor.setHexString.hexString: invalid hex string format. expected format: "#ffffff" or "#ffffffff"`);
429
+ throw new Error(`UIColor.setHexString.hexString: invalid hex string "${hexString}", expected "#ffffff" or "#ffffffff"`);
431
430
  }
432
431
  return this.setHexRGBA(hexNumber);
433
432
  }
434
433
  else {
435
- throw new Error(`UIColor.setHexString.hexString: invalid hex string format. expected format: "#ffffff" or "#ffffffff"`);
434
+ throw new Error(`UIColor.setHexString.hexString: invalid hex string "${hexString}", expected "#ffffff" or "#ffffffff"`);
436
435
  }
437
436
  }
438
437
  /** Sets from HSL values */
439
- setHSL(h, s, l, a = this._private_aInternal) {
438
+ setHSL(h, s, l, a = this.aInternal) {
440
439
  assertValidNumber(h, "UIColor.setHSL.h");
441
440
  assertValidNumber(s, "UIColor.setHSL.s");
442
441
  assertValidNumber(l, "UIColor.setHSL.l");
@@ -445,17 +444,17 @@ class UIColor {
445
444
  s = MathUtils.clamp(s, 0, 1);
446
445
  l = MathUtils.clamp(l, 0, 1);
447
446
  a = MathUtils.clamp(a, 0, 1);
448
- this._private_ensureHSLUpdatedFromRGB();
449
- if (h !== this._private_hInternal ||
450
- s !== this._private_sInternal ||
451
- l !== this._private_lInternal ||
452
- a !== this._private_aInternal) {
453
- this._private_hInternal = h;
454
- this._private_sInternal = s;
455
- this._private_lInternal = l;
456
- this._private_aInternal = a;
457
- this._private_rgbDirty = true;
458
- this._private_dirtyInternal = true;
447
+ this.ensureHSLUpdatedFromRGB();
448
+ if (h !== this.hInternal ||
449
+ s !== this.sInternal ||
450
+ l !== this.lInternal ||
451
+ a !== this.aInternal) {
452
+ this.hInternal = h;
453
+ this.sInternal = s;
454
+ this.lInternal = l;
455
+ this.aInternal = a;
456
+ this.rgbDirty = true;
457
+ this.dirtyInternal = true;
459
458
  }
460
459
  return this;
461
460
  }
@@ -464,125 +463,125 @@ class UIColor {
464
463
  *
465
464
  * @throws If color name unknown
466
465
  */
467
- setColorName(colorName, a = this._private_aInternal) {
466
+ setColorName(colorName, a = this.aInternal) {
468
467
  assertValidNumber(a, "UIColor.setColorName.a");
469
468
  a = MathUtils.clamp(a, 0, 1);
470
469
  const normalizedName = colorName.toLowerCase().trim();
471
470
  const hex = COLORS[normalizedName];
472
471
  if (hex === undefined) {
473
- throw new Error(`UIColor.setColorName.colorName: unknown color name`);
472
+ throw new Error(`UIColor.setColorName.colorName: unknown color name "${colorName}"`);
474
473
  }
475
474
  return this.setHexRGB(hex, a);
476
475
  }
477
476
  /** Sets from linear (GLSL) color space */
478
- setGLSLColor(r, g, b, a = this._private_aInternal) {
477
+ setGLSLColor(r, g, b, a = this.aInternal) {
479
478
  assertValidNumber(r, "UIColor.setGLSLColor.r");
480
479
  assertValidNumber(g, "UIColor.setGLSLColor.g");
481
480
  assertValidNumber(b, "UIColor.setGLSLColor.b");
482
481
  assertValidNumber(a, "UIColor.setGLSLColor.a");
483
482
  a = MathUtils.clamp(a, 0, 1);
484
- this._private_ensureRGBUpdatedFromHSL();
483
+ this.ensureRGBUpdatedFromHSL();
485
484
  const sRGBR = linearToSRGB(r);
486
485
  const sRGBG = linearToSRGB(g);
487
486
  const sRGBB = linearToSRGB(b);
488
- if (sRGBR !== this._private_rInternal ||
489
- sRGBG !== this._private_gInternal ||
490
- sRGBB !== this._private_bInternal ||
491
- a !== this._private_aInternal) {
492
- this._private_rInternal = sRGBR;
493
- this._private_gInternal = sRGBG;
494
- this._private_bInternal = sRGBB;
495
- this._private_aInternal = a;
496
- this._private_hslDirty = true;
497
- this._private_dirtyInternal = true;
487
+ if (sRGBR !== this.rInternal ||
488
+ sRGBG !== this.gInternal ||
489
+ sRGBB !== this.bInternal ||
490
+ a !== this.aInternal) {
491
+ this.rInternal = sRGBR;
492
+ this.gInternal = sRGBG;
493
+ this.bInternal = sRGBB;
494
+ this.aInternal = a;
495
+ this.hslDirty = true;
496
+ this.dirtyInternal = true;
498
497
  }
499
498
  return this;
500
499
  }
501
500
  /** Sets from Three.js Color */
502
- setThreeColor(threeColor, a = this._private_aInternal) {
501
+ setThreeColor(threeColor, a = this.aInternal) {
503
502
  assertValidNumber(a, "UIColor.setThreeColor.a");
504
503
  a = MathUtils.clamp(a, 0, 1);
505
- this._private_ensureRGBUpdatedFromHSL();
506
- if (threeColor.r !== this._private_rInternal ||
507
- threeColor.g !== this._private_gInternal ||
508
- threeColor.b !== this._private_bInternal ||
509
- a !== this._private_aInternal) {
510
- this._private_rInternal = threeColor.r;
511
- this._private_gInternal = threeColor.g;
512
- this._private_bInternal = threeColor.b;
513
- this._private_aInternal = a;
514
- this._private_hslDirty = true;
515
- this._private_dirtyInternal = true;
504
+ this.ensureRGBUpdatedFromHSL();
505
+ if (threeColor.r !== this.rInternal ||
506
+ threeColor.g !== this.gInternal ||
507
+ threeColor.b !== this.bInternal ||
508
+ a !== this.aInternal) {
509
+ this.rInternal = threeColor.r;
510
+ this.gInternal = threeColor.g;
511
+ this.bInternal = threeColor.b;
512
+ this.aInternal = a;
513
+ this.hslDirty = true;
514
+ this.dirtyInternal = true;
516
515
  }
517
516
  return this;
518
517
  }
519
518
  /** Returns CSS color string ("rgba(255, 0, 0, 1)") */
520
519
  toCSSColor() {
521
- this._private_ensureRGBUpdatedFromHSL();
522
- const r = Math.round(this._private_rInternal * 255);
523
- const g = Math.round(this._private_gInternal * 255);
524
- const b = Math.round(this._private_bInternal * 255);
525
- return `rgba(${r}, ${g}, ${b}, ${this._private_aInternal})`;
520
+ this.ensureRGBUpdatedFromHSL();
521
+ const r = Math.round(this.rInternal * 255);
522
+ const g = Math.round(this.gInternal * 255);
523
+ const b = Math.round(this.bInternal * 255);
524
+ return `rgba(${r}, ${g}, ${b}, ${this.aInternal})`;
526
525
  }
527
526
  /** Converts to linear (GLSL) color space */
528
527
  toGLSLColor(result = new Vector4()) {
529
- this._private_ensureRGBUpdatedFromHSL();
530
- result.x = srgbToLinear(this._private_rInternal);
531
- result.y = srgbToLinear(this._private_gInternal);
532
- result.z = srgbToLinear(this._private_bInternal);
533
- result.w = this._private_aInternal;
528
+ this.ensureRGBUpdatedFromHSL();
529
+ result.x = srgbToLinear(this.rInternal);
530
+ result.y = srgbToLinear(this.gInternal);
531
+ result.z = srgbToLinear(this.bInternal);
532
+ result.w = this.aInternal;
534
533
  return result;
535
534
  }
536
535
  /** Converts to Three.js Color (without alpha) */
537
536
  toThreeColor(result = new Color()) {
538
- this._private_ensureRGBUpdatedFromHSL();
539
- result.r = this._private_rInternal;
540
- result.g = this._private_gInternal;
541
- result.b = this._private_bInternal;
537
+ this.ensureRGBUpdatedFromHSL();
538
+ result.r = this.rInternal;
539
+ result.g = this.gInternal;
540
+ result.b = this.bInternal;
542
541
  return result;
543
542
  }
544
543
  /** Copies from another color */
545
544
  copy(color) {
546
545
  if (color instanceof UIColor) {
547
- this._private_ensureRGBUpdatedFromHSL();
548
- color._private_ensureRGBUpdatedFromHSL();
549
- if (this._private_rInternal !== color._private_rInternal ||
550
- this._private_gInternal !== color._private_gInternal ||
551
- this._private_bInternal !== color._private_bInternal ||
552
- this._private_aInternal !== color._private_aInternal) {
553
- this._private_rInternal = color._private_rInternal;
554
- this._private_gInternal = color._private_gInternal;
555
- this._private_bInternal = color._private_bInternal;
556
- this._private_aInternal = color._private_aInternal;
557
- this._private_hslDirty = true;
558
- this._private_dirtyInternal = true;
546
+ this.ensureRGBUpdatedFromHSL();
547
+ color.ensureRGBUpdatedFromHSL();
548
+ if (this.rInternal !== color.rInternal ||
549
+ this.gInternal !== color.gInternal ||
550
+ this.bInternal !== color.bInternal ||
551
+ this.aInternal !== color.aInternal) {
552
+ this.rInternal = color.rInternal;
553
+ this.gInternal = color.gInternal;
554
+ this.bInternal = color.bInternal;
555
+ this.aInternal = color.aInternal;
556
+ this.hslDirty = true;
557
+ this.dirtyInternal = true;
559
558
  }
560
559
  }
561
560
  else {
562
- this._private_ensureRGBUpdatedFromHSL();
563
- if (this._private_rInternal !== color.r ||
564
- this._private_gInternal !== color.g ||
565
- this._private_bInternal !== color.b ||
566
- this._private_aInternal !== 1) {
567
- this._private_rInternal = color.r;
568
- this._private_gInternal = color.g;
569
- this._private_bInternal = color.b;
570
- this._private_aInternal = 1;
571
- this._private_hslDirty = true;
572
- this._private_dirtyInternal = true;
561
+ this.ensureRGBUpdatedFromHSL();
562
+ if (this.rInternal !== color.r ||
563
+ this.gInternal !== color.g ||
564
+ this.bInternal !== color.b ||
565
+ this.aInternal !== 1) {
566
+ this.rInternal = color.r;
567
+ this.gInternal = color.g;
568
+ this.bInternal = color.b;
569
+ this.aInternal = 1;
570
+ this.hslDirty = true;
571
+ this.dirtyInternal = true;
573
572
  }
574
573
  }
575
574
  return this;
576
575
  }
577
576
  /** Returns copy of this color */
578
577
  clone() {
579
- this._private_ensureRGBUpdatedFromHSL();
580
- return new UIColor(this._private_rInternal, this._private_gInternal, this._private_bInternal, this._private_aInternal);
578
+ this.ensureRGBUpdatedFromHSL();
579
+ return new UIColor(this.rInternal, this.gInternal, this.bInternal, this.aInternal);
581
580
  }
582
581
  /** @internal */
583
- _private_ensureRGBUpdatedFromHSL() {
584
- if (this._private_rgbDirty) {
585
- const { _private_hInternal: h, _private_sInternal: s, _private_lInternal: l } = this;
582
+ ensureRGBUpdatedFromHSL() {
583
+ if (this.rgbDirty) {
584
+ const { hInternal: h, sInternal: s, lInternal: l } = this;
586
585
  const c = (1 - Math.abs(2 * l - 1)) * s;
587
586
  const hp = h / 60;
588
587
  const x = c * (1 - Math.abs((hp % 2) - 1));
@@ -598,15 +597,15 @@ class UIColor {
598
597
  ? [x, 0, c]
599
598
  : [c, 0, x];
600
599
  const m = l - c / 2;
601
- this._private_rInternal = r + m;
602
- this._private_gInternal = g + m;
603
- this._private_bInternal = b + m;
604
- this._private_rgbDirty = false;
600
+ this.rInternal = r + m;
601
+ this.gInternal = g + m;
602
+ this.bInternal = b + m;
603
+ this.rgbDirty = false;
605
604
  }
606
605
  }
607
- _private_ensureHSLUpdatedFromRGB() {
608
- if (this._private_hslDirty) {
609
- const { _private_rInternal: r, _private_gInternal: g, _private_bInternal: b } = this;
606
+ ensureHSLUpdatedFromRGB() {
607
+ if (this.hslDirty) {
608
+ const { rInternal: r, gInternal: g, bInternal: b } = this;
610
609
  const max = Math.max(r, g, b);
611
610
  const min = Math.min(r, g, b);
612
611
  const d = max - min;
@@ -625,12 +624,10 @@ class UIColor {
625
624
  h *= 60;
626
625
  }
627
626
  const s = d === 0 ? 0 : d / (1 - Math.abs(2 * l - 1));
628
- this._private_hInternal = h;
629
- this._private_sInternal = s;
630
- this._private_lInternal = l;
631
- this._private_hslDirty = false;
627
+ this.hInternal = h;
628
+ this.sInternal = s;
629
+ this.lInternal = l;
630
+ this.hslDirty = false;
632
631
  }
633
632
  }
634
633
  }
635
-
636
- export { UIColor };
@@ -1,5 +1,5 @@
1
1
  import { Matrix4 } from "three";
2
- import { UIMicroAnchorMode } from "../miscellaneous/micro/UIMicro.Internal";
2
+ import { UIMicroAnchorMode } from "../miscellaneous/micro/UIMicro.Internal.js";
3
3
  /**
4
4
  * Computes element transform matrix.
5
5
  * @returns Transform matrix (reused, do not store reference)