laymur 0.17.0 → 0.17.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.
- package/{src/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.ts → dist/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.d.ts} +2 -3
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.d.ts +22 -0
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.js +41 -0
- package/dist/core/constraints/UIConstraint.d.ts +12 -0
- package/dist/core/constraints/UIConstraint.js +11 -0
- package/dist/core/constraints/UICustomConstraint.d.ts +28 -0
- package/dist/core/constraints/UICustomConstraint.js +37 -0
- package/{src/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.ts → dist/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.d.ts} +2 -3
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.d.ts +20 -0
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.js +34 -0
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.d.ts +11 -0
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.js +3 -0
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.d.ts +36 -0
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.js +100 -0
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.d.ts +14 -0
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.js +4 -0
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.d.ts +44 -0
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.js +136 -0
- package/{src/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.ts → dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.d.ts} +2 -3
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.d.ts +22 -0
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.js +40 -0
- package/{src/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.ts → dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.d.ts} +8 -9
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.d.ts +43 -0
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.js +71 -0
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.d.ts +11 -0
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.js +3 -0
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.d.ts +32 -0
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.js +100 -0
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.d.ts +14 -0
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.js +4 -0
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.d.ts +44 -0
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.js +136 -0
- package/{src/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.ts → dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.d.ts} +2 -3
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.d.ts +22 -0
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.js +40 -0
- package/{src/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.ts → dist/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.d.ts} +2 -3
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.d.ts +20 -0
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.js +34 -0
- package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.d.ts +64 -0
- package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.js +19 -0
- package/dist/core/constraints/builders/UIConstraint2DBuilder.d.ts +46 -0
- package/dist/core/constraints/builders/UIConstraint2DBuilder.js +138 -0
- package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.d.ts +13 -0
- package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.js +3 -0
- package/dist/core/constraints/builders/UICoverConstraintBuilder.d.ts +29 -0
- package/dist/core/constraints/builders/UICoverConstraintBuilder.js +63 -0
- package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.d.ts +13 -0
- package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.js +3 -0
- package/dist/core/constraints/builders/UIFitConstraintBuilder.d.ts +29 -0
- package/dist/core/constraints/builders/UIFitConstraintBuilder.js +63 -0
- package/dist/core/elements/UIAnchor/UIAnchor.Internal.d.ts +12 -0
- package/dist/core/elements/UIAnchor/UIAnchor.Internal.js +5 -0
- package/dist/core/elements/UIAnchor/UIAnchor.d.ts +32 -0
- package/dist/core/elements/UIAnchor/UIAnchor.js +49 -0
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.d.ts +27 -0
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.js +15 -0
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.d.ts +77 -0
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.js +259 -0
- package/dist/core/elements/UIDummy/UIDummy.Internal.d.ts +30 -0
- package/dist/core/elements/UIDummy/UIDummy.Internal.js +8 -0
- package/dist/core/elements/UIDummy/UIDummy.d.ts +82 -0
- package/dist/core/elements/UIDummy/UIDummy.js +173 -0
- package/{src/core/elements/UIElement/UIElement.Internal.ts → dist/core/elements/UIElement/UIElement.Internal.d.ts} +5 -7
- package/dist/core/elements/UIElement/UIElement.Internal.js +5 -0
- package/dist/core/elements/UIElement/UIElement.d.ts +38 -0
- package/dist/core/elements/UIElement/UIElement.js +74 -0
- package/{src/core/elements/UIGraphics/UIGraphics.Internal.ts → dist/core/elements/UIGraphics/UIGraphics.Internal.d.ts} +5 -7
- package/dist/core/elements/UIGraphics/UIGraphics.Internal.js +7 -0
- package/dist/core/elements/UIGraphics/UIGraphics.d.ts +51 -0
- package/dist/core/elements/UIGraphics/UIGraphics.js +126 -0
- package/{src/core/elements/UIImage/UIImage.Internal.ts → dist/core/elements/UIImage/UIImage.Internal.d.ts} +2 -3
- package/dist/core/elements/UIImage/UIImage.d.ts +32 -0
- package/dist/core/elements/UIImage/UIImage.js +85 -0
- package/dist/core/elements/UINineSlice/UINineSlice.Internal.d.ts +23 -0
- package/dist/core/elements/UINineSlice/UINineSlice.Internal.js +12 -0
- package/dist/core/elements/UINineSlice/UINineSlice.d.ts +60 -0
- package/dist/core/elements/UINineSlice/UINineSlice.js +188 -0
- package/dist/core/elements/UIProgress/UIProgress.Internal.d.ts +14 -0
- package/dist/core/elements/UIProgress/UIProgress.Internal.js +3 -0
- package/dist/core/elements/UIProgress/UIProgress.d.ts +45 -0
- package/dist/core/elements/UIProgress/UIProgress.js +165 -0
- package/dist/core/elements/UIScene/UIScene.Internal.d.ts +43 -0
- package/dist/core/elements/UIScene/UIScene.Internal.js +27 -0
- package/dist/core/elements/UIScene/UIScene.d.ts +59 -0
- package/dist/core/elements/UIScene/UIScene.js +157 -0
- package/{src/core/elements/UIText/UIText.Interfaces.ts → dist/core/elements/UIText/UIText.Interfaces.d.ts} +16 -21
- package/dist/core/elements/UIText/UIText.Internal.d.ts +26 -0
- package/dist/core/elements/UIText/UIText.Internal.js +12 -0
- package/dist/core/elements/UIText/UIText.Measuring.d.ts +50 -0
- package/dist/core/elements/UIText/UIText.Measuring.js +153 -0
- package/dist/core/elements/UIText/UIText.Rendering.d.ts +20 -0
- package/dist/core/elements/UIText/UIText.Rendering.js +61 -0
- package/dist/core/elements/UIText/UIText.d.ts +71 -0
- package/dist/core/elements/UIText/UIText.js +265 -0
- package/{src/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.ts → dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.d.ts} +11 -14
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.js +5 -0
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.d.ts +63 -0
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.js +147 -0
- package/{src/core/layers/UILayer/UILayer.Internal.ts → dist/core/layers/UILayer/UILayer.Internal.d.ts} +11 -15
- package/dist/core/layers/UILayer/UILayer.Internal.js +7 -0
- package/dist/core/layers/UILayer/UILayer.d.ts +49 -0
- package/dist/core/layers/UILayer/UILayer.js +113 -0
- package/dist/core/miscellaneous/UIExpression.d.ts +69 -0
- package/dist/core/miscellaneous/UIExpression.js +128 -0
- package/dist/core/miscellaneous/UIMode.d.ts +23 -0
- package/dist/core/miscellaneous/UIMode.js +30 -0
- package/dist/core/miscellaneous/UIOrientation.d.ts +15 -0
- package/dist/core/miscellaneous/UIOrientation.js +20 -0
- package/dist/core/miscellaneous/UIPriority.d.ts +32 -0
- package/dist/core/miscellaneous/UIPriority.js +63 -0
- package/dist/core/miscellaneous/UIRelation.d.ts +23 -0
- package/dist/core/miscellaneous/UIRelation.js +40 -0
- package/dist/core/miscellaneous/UITransparencyMode.d.ts +9 -0
- package/dist/core/miscellaneous/UITransparencyMode.js +12 -0
- package/dist/core/miscellaneous/area/UIArea.d.ts +3 -0
- package/dist/core/miscellaneous/area/UIArea.js +5 -0
- package/dist/core/miscellaneous/area/UIAreaCircle.d.ts +15 -0
- package/dist/core/miscellaneous/area/UIAreaCircle.js +32 -0
- package/dist/core/miscellaneous/area/UIAreaPolygon.d.ts +12 -0
- package/dist/core/miscellaneous/area/UIAreaPolygon.js +40 -0
- package/dist/core/miscellaneous/area/UIAreaRectangle.d.ts +17 -0
- package/dist/core/miscellaneous/area/UIAreaRectangle.js +36 -0
- package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.d.ts +21 -0
- package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.js +72 -0
- package/dist/core/miscellaneous/asserts.d.ts +43 -0
- package/dist/core/miscellaneous/asserts.js +163 -0
- package/dist/core/miscellaneous/canvas.d.ts +31 -0
- package/dist/core/miscellaneous/canvas.js +37 -0
- package/dist/core/miscellaneous/color/UIColor.Internal.d.ts +7 -0
- package/dist/core/miscellaneous/color/UIColor.Internal.js +42 -0
- package/dist/core/miscellaneous/color/UIColor.d.ts +234 -0
- package/dist/core/miscellaneous/color/UIColor.js +636 -0
- package/dist/core/miscellaneous/computeTransform.d.ts +18 -0
- package/dist/core/miscellaneous/computeTransform.js +82 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.d.ts +19 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.js +168 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.d.ts +1 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.js +349 -0
- package/{src/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.ts → dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.d.ts} +8 -10
- package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.d.ts +1 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.js +357 -0
- package/dist/core/miscellaneous/generic-plane/shared.d.ts +38 -0
- package/dist/core/miscellaneous/generic-plane/shared.js +228 -0
- package/dist/core/miscellaneous/insets/UIInsets.Internal.d.ts +11 -0
- package/dist/core/miscellaneous/insets/UIInsets.Internal.js +3 -0
- package/dist/core/miscellaneous/insets/UIInsets.d.ts +48 -0
- package/dist/core/miscellaneous/insets/UIInsets.js +224 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.d.ts +9 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.js +19 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.d.ts +21 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.js +51 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.d.ts +16 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.js +48 -0
- package/dist/core/miscellaneous/math.d.ts +7 -0
- package/dist/core/miscellaneous/math.js +11 -0
- package/dist/core/miscellaneous/micro/UIMicro.Internal.d.ts +31 -0
- package/dist/core/miscellaneous/micro/UIMicro.Internal.js +15 -0
- package/dist/core/miscellaneous/micro/UIMicro.d.ts +59 -0
- package/dist/core/miscellaneous/micro/UIMicro.js +181 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicy.d.ts +3 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicy.js +9 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.js +50 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.js +50 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.d.ts +5 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.js +13 -0
- package/dist/core/miscellaneous/shared.d.ts +46 -0
- package/dist/core/miscellaneous/shared.js +37 -0
- package/{src/core/miscellaneous/text-span/UITextSpan.Internal.ts → dist/core/miscellaneous/text-span/UITextSpan.Internal.d.ts} +4 -5
- package/dist/core/miscellaneous/text-span/UITextSpan.d.ts +14 -0
- package/dist/core/miscellaneous/text-span/UITextSpan.js +36 -0
- package/dist/core/miscellaneous/text-style/UITextStyle.Internal.d.ts +48 -0
- package/dist/core/miscellaneous/text-style/UITextStyle.Internal.js +17 -0
- package/dist/core/miscellaneous/text-style/UITextStyle.d.ts +85 -0
- package/dist/core/miscellaneous/text-style/UITextStyle.js +372 -0
- package/dist/core/miscellaneous/texture/UITextureView.Internal.d.ts +49 -0
- package/dist/core/miscellaneous/texture/UITextureView.Internal.js +6 -0
- package/dist/core/miscellaneous/texture/UITextureView.d.ts +67 -0
- package/dist/core/miscellaneous/texture/UITextureView.js +234 -0
- package/dist/core/miscellaneous/webglCapabilities.d.ts +2 -0
- package/dist/core/miscellaneous/webglCapabilities.js +103 -0
- package/dist/core/shaders/UIImage.glsl.js +3 -0
- package/dist/core/shaders/UINineSlice.glsl.js +3 -0
- package/dist/core/shaders/UIProgress.glsl.js +3 -0
- package/dist/core/shaders/UIProgressMaskFunctionCircular.glsl.js +3 -0
- package/dist/core/shaders/UIProgressMaskFunctionDirectional.glsl.js +3 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.d.ts +17 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.d.ts +13 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.js +108 -0
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.d.ts +13 -0
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.d.ts +20 -0
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.js +75 -0
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.d.ts +49 -0
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.d.ts +215 -0
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.js +505 -0
- package/dist/index.js +51 -0
- package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.d.ts +21 -0
- package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.js +47 -0
- package/dist/particles/behaviorModules/UIBehaviorModule.d.ts +14 -0
- package/dist/particles/behaviorModules/UIBehaviorModule.js +9 -0
- package/dist/particles/behaviorModules/UIBehaviorPointGravity.d.ts +39 -0
- package/dist/particles/behaviorModules/UIBehaviorPointGravity.js +110 -0
- package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.d.ts +22 -0
- package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.js +66 -0
- package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.d.ts +20 -0
- package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.js +48 -0
- package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.d.ts +26 -0
- package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.js +66 -0
- package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.d.ts +20 -0
- package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.js +49 -0
- package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.d.ts +26 -0
- package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.js +70 -0
- package/dist/particles/elements/UIEmitter.Internal.d.ts +15 -0
- package/dist/particles/elements/UIEmitter.Internal.js +11 -0
- package/dist/particles/elements/UIEmitter.d.ts +68 -0
- package/dist/particles/elements/UIEmitter.js +203 -0
- package/dist/particles/index.js +18 -0
- package/dist/particles/instancedParticle/UIInstancedParticle.Internal.d.ts +13 -0
- package/dist/particles/instancedParticle/UIInstancedParticle.Internal.js +211 -0
- package/dist/particles/instancedParticle/UIInstancedParticle.d.ts +17 -0
- package/dist/particles/instancedParticle/UIInstancedParticle.js +93 -0
- package/dist/particles/miscellaneous/miscellaneous.d.ts +32 -0
- package/dist/particles/miscellaneous/miscellaneous.js +67 -0
- package/dist/particles/renderingModules/UIRenderingColorOverLife.d.ts +14 -0
- package/dist/particles/renderingModules/UIRenderingColorOverLife.js +32 -0
- package/dist/particles/renderingModules/UIRenderingColorOverVelocity.d.ts +15 -0
- package/dist/particles/renderingModules/UIRenderingColorOverVelocity.js +37 -0
- package/dist/particles/renderingModules/UIRenderingModule.d.ts +8 -0
- package/dist/particles/renderingModules/UIRenderingModule.js +9 -0
- package/dist/particles/renderingModules/UIRenderingTexture.d.ts +14 -0
- package/dist/particles/renderingModules/UIRenderingTexture.js +26 -0
- package/dist/particles/shaders/UIRenderingColorOverLife.glsl.js +3 -0
- package/dist/particles/shaders/UIRenderingColorOverVelocity.glsl.js +3 -0
- package/dist/particles/shaders/UIRenderingTexture.glsl.js +3 -0
- package/dist/particles/spawnModules/UISpawnModule.d.ts +9 -0
- package/dist/particles/spawnModules/UISpawnModule.js +9 -0
- package/dist/particles/spawnModules/UISpawnOffset.d.ts +21 -0
- package/dist/particles/spawnModules/UISpawnOffset.js +46 -0
- package/dist/particles/spawnModules/UISpawnRandomLifetime.d.ts +20 -0
- package/dist/particles/spawnModules/UISpawnRandomLifetime.js +47 -0
- package/dist/particles/spawnModules/UISpawnRandomRotation.d.ts +20 -0
- package/dist/particles/spawnModules/UISpawnRandomRotation.js +45 -0
- package/dist/particles/spawnModules/UISpawnRandomScale.d.ts +26 -0
- package/dist/particles/spawnModules/UISpawnRandomScale.js +60 -0
- package/dist/particles/spawnModules/UISpawnRandomTorque.d.ts +20 -0
- package/dist/particles/spawnModules/UISpawnRandomTorque.js +45 -0
- package/dist/particles/spawnModules/UISpawnRandomVelocity.d.ts +26 -0
- package/dist/particles/spawnModules/UISpawnRandomVelocity.js +64 -0
- package/dist/particles/spawnModules/UISpawnRectangle.d.ts +27 -0
- package/dist/particles/spawnModules/UISpawnRectangle.js +62 -0
- package/package.json +8 -1
- package/.claude/settings.local.json +0 -9
- package/.editorconfig +0 -14
- package/CLAUDE.md +0 -181
- package/assets/logotype.png +0 -0
- package/eslint.config.js +0 -111
- package/rollup.config.js +0 -52
- package/src/core/constraints/UIAspectConstraint/UIAspectConstraint.ts +0 -60
- package/src/core/constraints/UIConstraint.ts +0 -20
- package/src/core/constraints/UICustomConstraint.ts +0 -62
- package/src/core/constraints/UIHeightConstraint/UIHeightConstraint.ts +0 -52
- package/src/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.ts +0 -13
- package/src/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.ts +0 -139
- package/src/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.ts +0 -16
- package/src/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.ts +0 -189
- package/src/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.ts +0 -68
- package/src/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.ts +0 -94
- package/src/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.ts +0 -13
- package/src/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.ts +0 -135
- package/src/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.ts +0 -16
- package/src/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.ts +0 -189
- package/src/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.ts +0 -68
- package/src/core/constraints/UIWidthConstraint/UIWidthConstraint.ts +0 -52
- package/src/core/constraints/builders/UIConstraint2DBuilder.Internal.ts +0 -84
- package/src/core/constraints/builders/UIConstraint2DBuilder.ts +0 -168
- package/src/core/constraints/builders/UICoverConstraintBuilder.Internal.ts +0 -15
- package/src/core/constraints/builders/UICoverConstraintBuilder.ts +0 -84
- package/src/core/constraints/builders/UIFitConstraintBuilder.Internal.ts +0 -15
- package/src/core/constraints/builders/UIFitConstraintBuilder.ts +0 -84
- package/src/core/elements/UIAnchor/UIAnchor.Internal.ts +0 -13
- package/src/core/elements/UIAnchor/UIAnchor.ts +0 -70
- package/src/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.ts +0 -30
- package/src/core/elements/UIAnimatedImage/UIAnimatedImage.ts +0 -355
- package/src/core/elements/UIDummy/UIDummy.Internal.ts +0 -33
- package/src/core/elements/UIDummy/UIDummy.ts +0 -244
- package/src/core/elements/UIElement/UIElement.ts +0 -127
- package/src/core/elements/UIGraphics/UIGraphics.ts +0 -168
- package/src/core/elements/UIImage/UIImage.ts +0 -138
- package/src/core/elements/UINineSlice/UINineSlice.Internal.ts +0 -26
- package/src/core/elements/UINineSlice/UINineSlice.ts +0 -296
- package/src/core/elements/UIProgress/UIProgress.Internal.ts +0 -24
- package/src/core/elements/UIProgress/UIProgress.ts +0 -259
- package/src/core/elements/UIScene/UIScene.Internal.ts +0 -46
- package/src/core/elements/UIScene/UIScene.ts +0 -259
- package/src/core/elements/UIText/UIText.Internal.ts +0 -29
- package/src/core/elements/UIText/UIText.Measuring.ts +0 -183
- package/src/core/elements/UIText/UIText.Rendering.ts +0 -83
- package/src/core/elements/UIText/UIText.ts +0 -376
- package/src/core/layers/UIFullscreenLayer/UIFullscreenLayer.ts +0 -233
- package/src/core/layers/UILayer/UILayer.ts +0 -156
- package/src/core/miscellaneous/UIExpression.ts +0 -142
- package/src/core/miscellaneous/UIMode.ts +0 -29
- package/src/core/miscellaneous/UIOrientation.ts +0 -18
- package/src/core/miscellaneous/UIPriority.ts +0 -63
- package/src/core/miscellaneous/UIRelation.ts +0 -39
- package/src/core/miscellaneous/UITransparencyMode.ts +0 -9
- package/src/core/miscellaneous/area/UIArea.ts +0 -5
- package/src/core/miscellaneous/area/UIAreaCircle.ts +0 -32
- package/src/core/miscellaneous/area/UIAreaPolygon.ts +0 -50
- package/src/core/miscellaneous/area/UIAreaRectangle.ts +0 -38
- package/src/core/miscellaneous/area/UIAreaRoundedRectangle.ts +0 -78
- package/src/core/miscellaneous/asserts.ts +0 -187
- package/src/core/miscellaneous/canvas.ts +0 -73
- package/src/core/miscellaneous/color/UIColor.Internal.ts +0 -89
- package/src/core/miscellaneous/color/UIColor.ts +0 -844
- package/src/core/miscellaneous/computeTransform.ts +0 -127
- package/src/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.ts +0 -235
- package/src/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.ts +0 -524
- package/src/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.ts +0 -448
- package/src/core/miscellaneous/generic-plane/shared.ts +0 -323
- package/src/core/miscellaneous/insets/UIInsets.Internal.ts +0 -9
- package/src/core/miscellaneous/insets/UIInsets.ts +0 -248
- package/src/core/miscellaneous/mask-function/UIProgressMaskFunction.ts +0 -24
- package/src/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.ts +0 -58
- package/src/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.ts +0 -52
- package/src/core/miscellaneous/math.ts +0 -16
- package/src/core/miscellaneous/micro/UIMicro.Internal.ts +0 -33
- package/src/core/miscellaneous/micro/UIMicro.ts +0 -222
- package/src/core/miscellaneous/resize-policy/UIResizePolicy.ts +0 -8
- package/src/core/miscellaneous/resize-policy/UIResizePolicyCover.ts +0 -57
- package/src/core/miscellaneous/resize-policy/UIResizePolicyCross.ts +0 -65
- package/src/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.ts +0 -65
- package/src/core/miscellaneous/resize-policy/UIResizePolicyFit.ts +0 -57
- package/src/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.ts +0 -65
- package/src/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.ts +0 -65
- package/src/core/miscellaneous/resize-policy/UIResizePolicyNone.ts +0 -11
- package/src/core/miscellaneous/shared.ts +0 -73
- package/src/core/miscellaneous/text-span/UITextSpan.ts +0 -43
- package/src/core/miscellaneous/text-style/UITextStyle.Internal.ts +0 -52
- package/src/core/miscellaneous/text-style/UITextStyle.ts +0 -479
- package/src/core/miscellaneous/texture/UITextureView.Internal.ts +0 -55
- package/src/core/miscellaneous/texture/UITextureView.ts +0 -308
- package/src/core/miscellaneous/webglCapabilities.ts +0 -129
- package/src/core/shaders/UIImage.glsl +0 -10
- package/src/core/shaders/UINineSlice.glsl +0 -53
- package/src/core/shaders/UIProgress.glsl +0 -15
- package/src/core/shaders/UIProgressMaskFunctionCircular.glsl +0 -13
- package/src/core/shaders/UIProgressMaskFunctionDirectional.glsl +0 -12
- package/src/core/shaders/glsl.d.ts +0 -27
- package/src/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.ts +0 -23
- package/src/core/wrappers/UIInputWrapper/UIInputWrapper.ts +0 -124
- package/src/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.ts +0 -22
- package/src/core/wrappers/UISceneWrapper/UISceneWrapper.ts +0 -101
- package/src/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.ts +0 -58
- package/src/core/wrappers/UISolverWrapper/UISolverWrapper.ts +0 -605
- package/src/particles/behaviorModules/UIBehaviorDirectionalGravity.ts +0 -70
- package/src/particles/behaviorModules/UIBehaviorModule.ts +0 -20
- package/src/particles/behaviorModules/UIBehaviorPointGravity.ts +0 -173
- package/src/particles/behaviorModules/UIBehaviorScaleOverLife.ts +0 -104
- package/src/particles/behaviorModules/UIBehaviorTorqueDamping.ts +0 -75
- package/src/particles/behaviorModules/UIBehaviorTorqueNoise.ts +0 -115
- package/src/particles/behaviorModules/UIBehaviorVelocityDamping.ts +0 -77
- package/src/particles/behaviorModules/UIBehaviorVelocityNoise.ts +0 -118
- package/src/particles/elements/UIEmitter.Internal.ts +0 -22
- package/src/particles/elements/UIEmitter.ts +0 -313
- package/src/particles/instancedParticle/UIInstancedParticle.Internal.ts +0 -263
- package/src/particles/instancedParticle/UIInstancedParticle.ts +0 -138
- package/src/particles/miscellaneous/miscellaneous.ts +0 -115
- package/src/particles/renderingModules/UIRenderingColorOverLife.ts +0 -39
- package/src/particles/renderingModules/UIRenderingColorOverVelocity.ts +0 -49
- package/src/particles/renderingModules/UIRenderingModule.ts +0 -17
- package/src/particles/renderingModules/UIRenderingTexture.ts +0 -30
- package/src/particles/shaders/UIRenderingColorOverLife.glsl +0 -4
- package/src/particles/shaders/UIRenderingColorOverVelocity.glsl +0 -6
- package/src/particles/shaders/UIRenderingTexture.glsl +0 -4
- package/src/particles/spawnModules/UISpawnModule.ts +0 -22
- package/src/particles/spawnModules/UISpawnOffset.ts +0 -62
- package/src/particles/spawnModules/UISpawnRandomLifetime.ts +0 -68
- package/src/particles/spawnModules/UISpawnRandomRotation.ts +0 -60
- package/src/particles/spawnModules/UISpawnRandomScale.ts +0 -81
- package/src/particles/spawnModules/UISpawnRandomTorque.ts +0 -62
- package/src/particles/spawnModules/UISpawnRandomVelocity.ts +0 -92
- package/src/particles/spawnModules/UISpawnRectangle.ts +0 -81
- package/tsconfig.json +0 -29
- /package/{src/core/index.ts → dist/core/index.d.ts} +0 -0
- /package/{src/particles/index.ts → dist/particles/index.d.ts} +0 -0
|
@@ -0,0 +1,636 @@
|
|
|
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
|
+
|
|
6
|
+
/** RGBA color with RGB, HSL, hex, and named color support */
|
|
7
|
+
class UIColor {
|
|
8
|
+
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;
|
|
19
|
+
if (args.length > 0) {
|
|
20
|
+
this.set(...args);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/** Black (0x000000) */
|
|
24
|
+
static get black() {
|
|
25
|
+
return new UIColor("black");
|
|
26
|
+
}
|
|
27
|
+
/** White (0xffffff) */
|
|
28
|
+
static get white() {
|
|
29
|
+
return new UIColor("white");
|
|
30
|
+
}
|
|
31
|
+
/** Red (0xff0000) */
|
|
32
|
+
static get red() {
|
|
33
|
+
return new UIColor("red");
|
|
34
|
+
}
|
|
35
|
+
/** Green (0x008000) */
|
|
36
|
+
static get green() {
|
|
37
|
+
return new UIColor("green");
|
|
38
|
+
}
|
|
39
|
+
/** Blue (0x0000ff) */
|
|
40
|
+
static get blue() {
|
|
41
|
+
return new UIColor("blue");
|
|
42
|
+
}
|
|
43
|
+
/** Yellow (0xffff00) */
|
|
44
|
+
static get yellow() {
|
|
45
|
+
return new UIColor("yellow");
|
|
46
|
+
}
|
|
47
|
+
/** Cyan (0x00ffff) */
|
|
48
|
+
static get cyan() {
|
|
49
|
+
return new UIColor("cyan");
|
|
50
|
+
}
|
|
51
|
+
/** Magenta (0xff00ff) */
|
|
52
|
+
static get magenta() {
|
|
53
|
+
return new UIColor("magenta");
|
|
54
|
+
}
|
|
55
|
+
/** Gray (0x808080) */
|
|
56
|
+
static get gray() {
|
|
57
|
+
return new UIColor("gray");
|
|
58
|
+
}
|
|
59
|
+
/** Grey (0x808080) */
|
|
60
|
+
static get grey() {
|
|
61
|
+
return new UIColor("grey");
|
|
62
|
+
}
|
|
63
|
+
/** Silver (0xc0c0c0) */
|
|
64
|
+
static get silver() {
|
|
65
|
+
return new UIColor("silver");
|
|
66
|
+
}
|
|
67
|
+
/** Maroon (0x800000) */
|
|
68
|
+
static get maroon() {
|
|
69
|
+
return new UIColor("maroon");
|
|
70
|
+
}
|
|
71
|
+
/** Olive (0x808000) */
|
|
72
|
+
static get olive() {
|
|
73
|
+
return new UIColor("olive");
|
|
74
|
+
}
|
|
75
|
+
/** Lime (0x00ff00) */
|
|
76
|
+
static get lime() {
|
|
77
|
+
return new UIColor("lime");
|
|
78
|
+
}
|
|
79
|
+
/** Aqua (0x00ffff) */
|
|
80
|
+
static get aqua() {
|
|
81
|
+
return new UIColor("aqua");
|
|
82
|
+
}
|
|
83
|
+
/** Teal (0x008080) */
|
|
84
|
+
static get teal() {
|
|
85
|
+
return new UIColor("teal");
|
|
86
|
+
}
|
|
87
|
+
/** Navy (0x000080) */
|
|
88
|
+
static get navy() {
|
|
89
|
+
return new UIColor("navy");
|
|
90
|
+
}
|
|
91
|
+
/** Fuchsia (0xff00ff) */
|
|
92
|
+
static get fuchsia() {
|
|
93
|
+
return new UIColor("fuchsia");
|
|
94
|
+
}
|
|
95
|
+
/** Purple (0x800080) */
|
|
96
|
+
static get purple() {
|
|
97
|
+
return new UIColor("purple");
|
|
98
|
+
}
|
|
99
|
+
/** Orange (0xffa500) */
|
|
100
|
+
static get orange() {
|
|
101
|
+
return new UIColor("orange");
|
|
102
|
+
}
|
|
103
|
+
/** Pink (0xffc0cb) */
|
|
104
|
+
static get pink() {
|
|
105
|
+
return new UIColor("pink");
|
|
106
|
+
}
|
|
107
|
+
/** Brown (0xa52a2a) */
|
|
108
|
+
static get brown() {
|
|
109
|
+
return new UIColor("brown");
|
|
110
|
+
}
|
|
111
|
+
/** Gold (0xffd700) */
|
|
112
|
+
static get gold() {
|
|
113
|
+
return new UIColor("gold");
|
|
114
|
+
}
|
|
115
|
+
/** Violet (0xee82ee) */
|
|
116
|
+
static get violet() {
|
|
117
|
+
return new UIColor("violet");
|
|
118
|
+
}
|
|
119
|
+
/** Indigo (0x4b0082) */
|
|
120
|
+
static get indigo() {
|
|
121
|
+
return new UIColor("indigo");
|
|
122
|
+
}
|
|
123
|
+
/** Coral (0xff7f50) */
|
|
124
|
+
static get coral() {
|
|
125
|
+
return new UIColor("coral");
|
|
126
|
+
}
|
|
127
|
+
/** Salmon (0xfa8072) */
|
|
128
|
+
static get salmon() {
|
|
129
|
+
return new UIColor("salmon");
|
|
130
|
+
}
|
|
131
|
+
/** Khaki (0xf0e68c) */
|
|
132
|
+
static get khaki() {
|
|
133
|
+
return new UIColor("khaki");
|
|
134
|
+
}
|
|
135
|
+
/** Plum (0xdda0dd) */
|
|
136
|
+
static get plum() {
|
|
137
|
+
return new UIColor("plum");
|
|
138
|
+
}
|
|
139
|
+
/** Orchid (0xda70d6) */
|
|
140
|
+
static get orchid() {
|
|
141
|
+
return new UIColor("orchid");
|
|
142
|
+
}
|
|
143
|
+
/** Tan (0xd2b48c) */
|
|
144
|
+
static get tan() {
|
|
145
|
+
return new UIColor("tan");
|
|
146
|
+
}
|
|
147
|
+
/** Beige (0xf5f5dc) */
|
|
148
|
+
static get beige() {
|
|
149
|
+
return new UIColor("beige");
|
|
150
|
+
}
|
|
151
|
+
/** Mint (0x98fb98) */
|
|
152
|
+
static get mint() {
|
|
153
|
+
return new UIColor("mint");
|
|
154
|
+
}
|
|
155
|
+
/** Lavender (0xe6e6fa) */
|
|
156
|
+
static get lavender() {
|
|
157
|
+
return new UIColor("lavender");
|
|
158
|
+
}
|
|
159
|
+
/** Crimson (0xdc143c) */
|
|
160
|
+
static get crimson() {
|
|
161
|
+
return new UIColor("crimson");
|
|
162
|
+
}
|
|
163
|
+
/** Azure (0xf0ffff) */
|
|
164
|
+
static get azure() {
|
|
165
|
+
return new UIColor("azure");
|
|
166
|
+
}
|
|
167
|
+
/** Ivory (0xfffff0) */
|
|
168
|
+
static get ivory() {
|
|
169
|
+
return new UIColor("ivory");
|
|
170
|
+
}
|
|
171
|
+
/** Snow (0xfffafa) */
|
|
172
|
+
static get snow() {
|
|
173
|
+
return new UIColor("snow");
|
|
174
|
+
}
|
|
175
|
+
/** Red component (0 to 1) */
|
|
176
|
+
get r() {
|
|
177
|
+
this._private_ensureRGBUpdatedFromHSL();
|
|
178
|
+
return this._private_rInternal;
|
|
179
|
+
}
|
|
180
|
+
/** Green component (0 to 1) */
|
|
181
|
+
get g() {
|
|
182
|
+
this._private_ensureRGBUpdatedFromHSL();
|
|
183
|
+
return this._private_gInternal;
|
|
184
|
+
}
|
|
185
|
+
/** Blue component (0 to 1) */
|
|
186
|
+
get b() {
|
|
187
|
+
this._private_ensureRGBUpdatedFromHSL();
|
|
188
|
+
return this._private_bInternal;
|
|
189
|
+
}
|
|
190
|
+
/** Alpha component (0 to 1) */
|
|
191
|
+
get a() {
|
|
192
|
+
return this._private_aInternal;
|
|
193
|
+
}
|
|
194
|
+
/** Hue component (0 to 360) */
|
|
195
|
+
get hue() {
|
|
196
|
+
this._private_ensureHSLUpdatedFromRGB();
|
|
197
|
+
return this._private_hInternal;
|
|
198
|
+
}
|
|
199
|
+
/** Saturation component (0 to 1) */
|
|
200
|
+
get saturation() {
|
|
201
|
+
this._private_ensureHSLUpdatedFromRGB();
|
|
202
|
+
return this._private_sInternal;
|
|
203
|
+
}
|
|
204
|
+
/** Lightness component (0 to 1) */
|
|
205
|
+
get lightness() {
|
|
206
|
+
this._private_ensureHSLUpdatedFromRGB();
|
|
207
|
+
return this._private_lInternal;
|
|
208
|
+
}
|
|
209
|
+
/** @internal */
|
|
210
|
+
get dirty() {
|
|
211
|
+
return this._private_dirtyInternal;
|
|
212
|
+
}
|
|
213
|
+
/** Red component (0 to 1) */
|
|
214
|
+
set r(value) {
|
|
215
|
+
assertValidNumber(value, "UIColor.r");
|
|
216
|
+
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;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
/** Green component (0 to 1) */
|
|
225
|
+
set g(value) {
|
|
226
|
+
assertValidNumber(value, "UIColor.g");
|
|
227
|
+
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;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
/** Blue component (0 to 1) */
|
|
236
|
+
set b(value) {
|
|
237
|
+
assertValidNumber(value, "UIColor.b");
|
|
238
|
+
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;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
/** Alpha component (0 to 1) */
|
|
247
|
+
set a(value) {
|
|
248
|
+
assertValidNumber(value, "UIColor.a");
|
|
249
|
+
value = MathUtils.clamp(value, 0, 1);
|
|
250
|
+
if (value !== this._private_aInternal) {
|
|
251
|
+
this._private_aInternal = value;
|
|
252
|
+
this._private_dirtyInternal = true;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
/** Hue component (0 to 360) */
|
|
256
|
+
set hue(value) {
|
|
257
|
+
assertValidNumber(value, "UIColor.hue");
|
|
258
|
+
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;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
/** Saturation component (0 to 1) */
|
|
267
|
+
set saturation(value) {
|
|
268
|
+
assertValidNumber(value, "UIColor.saturation");
|
|
269
|
+
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;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
/** Lightness component (0 to 1) */
|
|
278
|
+
set lightness(value) {
|
|
279
|
+
assertValidNumber(value, "UIColor.lightness");
|
|
280
|
+
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;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
/** @internal */
|
|
289
|
+
setDirtyFalse() {
|
|
290
|
+
this._private_dirtyInternal = false;
|
|
291
|
+
}
|
|
292
|
+
set(...args) {
|
|
293
|
+
if (args.length === 0 || args[0] === undefined) {
|
|
294
|
+
return this.setRGBA(1, 1, 1, 1);
|
|
295
|
+
}
|
|
296
|
+
if (args.length >= 3 && typeof args[0] === "number") {
|
|
297
|
+
const [r, g, b, a = 1] = args;
|
|
298
|
+
return this.setRGBA(r, g, b, a);
|
|
299
|
+
}
|
|
300
|
+
const [firstArgument, a = 1] = args;
|
|
301
|
+
if (typeof firstArgument === "string") {
|
|
302
|
+
return firstArgument.startsWith("#")
|
|
303
|
+
? this.setHexString(firstArgument)
|
|
304
|
+
: this.setColorName(firstArgument, a);
|
|
305
|
+
}
|
|
306
|
+
if (firstArgument instanceof UIColor) {
|
|
307
|
+
return this.copy(firstArgument);
|
|
308
|
+
}
|
|
309
|
+
if (firstArgument instanceof Color) {
|
|
310
|
+
return this.setThreeColor(firstArgument, a);
|
|
311
|
+
}
|
|
312
|
+
if (typeof firstArgument === "number") {
|
|
313
|
+
return this.setHexRGB(firstArgument, a);
|
|
314
|
+
}
|
|
315
|
+
throw new Error("UIColor.set: cannot create color from provided arguments");
|
|
316
|
+
}
|
|
317
|
+
/** Sets RGBA components directly */
|
|
318
|
+
setRGBA(r, g, b, a = this._private_aInternal) {
|
|
319
|
+
assertValidNumber(r, "UIColor.setRGBA.r");
|
|
320
|
+
assertValidNumber(g, "UIColor.setRGBA.g");
|
|
321
|
+
assertValidNumber(b, "UIColor.setRGBA.b");
|
|
322
|
+
assertValidNumber(a, "UIColor.setRGBA.a");
|
|
323
|
+
r = MathUtils.clamp(r, 0, 1);
|
|
324
|
+
g = MathUtils.clamp(g, 0, 1);
|
|
325
|
+
b = MathUtils.clamp(b, 0, 1);
|
|
326
|
+
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;
|
|
338
|
+
}
|
|
339
|
+
return this;
|
|
340
|
+
}
|
|
341
|
+
/** Returns RGBA as 32-bit hex (RRGGBBAA) */
|
|
342
|
+
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));
|
|
348
|
+
}
|
|
349
|
+
/** Returns RGB as 24-bit hex (RRGGBB) */
|
|
350
|
+
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));
|
|
355
|
+
}
|
|
356
|
+
/** Returns RGB as hex string ("#ffffff") */
|
|
357
|
+
getHexStringRGB() {
|
|
358
|
+
const hex = this.getHexRGB();
|
|
359
|
+
return `#${hex.toString(16).padStart(6, "0")}`;
|
|
360
|
+
}
|
|
361
|
+
/** Returns RGBA as hex string ("#ffffffff") */
|
|
362
|
+
getHexStringRGBA() {
|
|
363
|
+
const hex = this.getHexRGBA();
|
|
364
|
+
return `#${hex.toString(16).padStart(8, "0")}`;
|
|
365
|
+
}
|
|
366
|
+
/** Sets from 32-bit hex RGBA (RRGGBBAA) */
|
|
367
|
+
setHexRGBA(hex) {
|
|
368
|
+
assertValidNumber(hex, "UIColor.setHexRGBA.hex");
|
|
369
|
+
this._private_ensureRGBUpdatedFromHSL();
|
|
370
|
+
const r = ((hex >> 16) & 0xff) / 255;
|
|
371
|
+
const g = ((hex >> 8) & 0xff) / 255;
|
|
372
|
+
const b = (hex & 0xff) / 255;
|
|
373
|
+
const a = ((hex >> 24) & 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;
|
|
384
|
+
}
|
|
385
|
+
return this;
|
|
386
|
+
}
|
|
387
|
+
/** Sets from 24-bit hex RGB (RRGGBB) */
|
|
388
|
+
setHexRGB(hex, a = this._private_aInternal) {
|
|
389
|
+
assertValidNumber(hex, "UIColor.setHexRGB.hex");
|
|
390
|
+
assertValidNumber(a, "UIColor.setHexRGB.a");
|
|
391
|
+
a = MathUtils.clamp(a, 0, 1);
|
|
392
|
+
this._private_ensureRGBUpdatedFromHSL();
|
|
393
|
+
const r = ((hex >> 16) & 0xff) / 255;
|
|
394
|
+
const g = ((hex >> 8) & 0xff) / 255;
|
|
395
|
+
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;
|
|
406
|
+
}
|
|
407
|
+
return this;
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Sets from hex string.
|
|
411
|
+
*
|
|
412
|
+
* @param hexString - Format: "#ffffff" or "#ffffffff"
|
|
413
|
+
* @throws If format invalid
|
|
414
|
+
*/
|
|
415
|
+
setHexString(hexString) {
|
|
416
|
+
if (!hexString.startsWith("#")) {
|
|
417
|
+
throw new Error(`UIColor.setHexString.hexString: invalid hex string format. expected format: "#ffffff" or "#ffffffff"`);
|
|
418
|
+
}
|
|
419
|
+
const hex = hexString.slice(1);
|
|
420
|
+
if (hex.length === 6) {
|
|
421
|
+
const hexNumber = parseInt(hex, 16);
|
|
422
|
+
if (isNaN(hexNumber)) {
|
|
423
|
+
throw new Error(`UIColor.setHexString.hexString: invalid hex string format. expected format: "#ffffff" or "#ffffffff"`);
|
|
424
|
+
}
|
|
425
|
+
return this.setHexRGB(hexNumber);
|
|
426
|
+
}
|
|
427
|
+
else if (hex.length === 8) {
|
|
428
|
+
const hexNumber = parseInt(hex, 16);
|
|
429
|
+
if (isNaN(hexNumber)) {
|
|
430
|
+
throw new Error(`UIColor.setHexString.hexString: invalid hex string format. expected format: "#ffffff" or "#ffffffff"`);
|
|
431
|
+
}
|
|
432
|
+
return this.setHexRGBA(hexNumber);
|
|
433
|
+
}
|
|
434
|
+
else {
|
|
435
|
+
throw new Error(`UIColor.setHexString.hexString: invalid hex string format. expected format: "#ffffff" or "#ffffffff"`);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
/** Sets from HSL values */
|
|
439
|
+
setHSL(h, s, l, a = this._private_aInternal) {
|
|
440
|
+
assertValidNumber(h, "UIColor.setHSL.h");
|
|
441
|
+
assertValidNumber(s, "UIColor.setHSL.s");
|
|
442
|
+
assertValidNumber(l, "UIColor.setHSL.l");
|
|
443
|
+
assertValidNumber(a, "UIColor.setHSL.a");
|
|
444
|
+
h = MathUtils.clamp(h, 0, 360);
|
|
445
|
+
s = MathUtils.clamp(s, 0, 1);
|
|
446
|
+
l = MathUtils.clamp(l, 0, 1);
|
|
447
|
+
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;
|
|
459
|
+
}
|
|
460
|
+
return this;
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* Sets from predefined name.
|
|
464
|
+
*
|
|
465
|
+
* @throws If color name unknown
|
|
466
|
+
*/
|
|
467
|
+
setColorName(colorName, a = this._private_aInternal) {
|
|
468
|
+
assertValidNumber(a, "UIColor.setColorName.a");
|
|
469
|
+
a = MathUtils.clamp(a, 0, 1);
|
|
470
|
+
const normalizedName = colorName.toLowerCase().trim();
|
|
471
|
+
const hex = COLORS[normalizedName];
|
|
472
|
+
if (hex === undefined) {
|
|
473
|
+
throw new Error(`UIColor.setColorName.colorName: unknown color name`);
|
|
474
|
+
}
|
|
475
|
+
return this.setHexRGB(hex, a);
|
|
476
|
+
}
|
|
477
|
+
/** Sets from linear (GLSL) color space */
|
|
478
|
+
setGLSLColor(r, g, b, a = this._private_aInternal) {
|
|
479
|
+
assertValidNumber(r, "UIColor.setGLSLColor.r");
|
|
480
|
+
assertValidNumber(g, "UIColor.setGLSLColor.g");
|
|
481
|
+
assertValidNumber(b, "UIColor.setGLSLColor.b");
|
|
482
|
+
assertValidNumber(a, "UIColor.setGLSLColor.a");
|
|
483
|
+
a = MathUtils.clamp(a, 0, 1);
|
|
484
|
+
this._private_ensureRGBUpdatedFromHSL();
|
|
485
|
+
const sRGBR = linearToSRGB(r);
|
|
486
|
+
const sRGBG = linearToSRGB(g);
|
|
487
|
+
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;
|
|
498
|
+
}
|
|
499
|
+
return this;
|
|
500
|
+
}
|
|
501
|
+
/** Sets from Three.js Color */
|
|
502
|
+
setThreeColor(threeColor, a = this._private_aInternal) {
|
|
503
|
+
assertValidNumber(a, "UIColor.setThreeColor.a");
|
|
504
|
+
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;
|
|
516
|
+
}
|
|
517
|
+
return this;
|
|
518
|
+
}
|
|
519
|
+
/** Returns CSS color string ("rgba(255, 0, 0, 1)") */
|
|
520
|
+
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})`;
|
|
526
|
+
}
|
|
527
|
+
/** Converts to linear (GLSL) color space */
|
|
528
|
+
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;
|
|
534
|
+
return result;
|
|
535
|
+
}
|
|
536
|
+
/** Converts to Three.js Color (without alpha) */
|
|
537
|
+
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;
|
|
542
|
+
return result;
|
|
543
|
+
}
|
|
544
|
+
/** Copies from another color */
|
|
545
|
+
copy(color) {
|
|
546
|
+
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;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
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;
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
return this;
|
|
576
|
+
}
|
|
577
|
+
/** Returns copy of this color */
|
|
578
|
+
clone() {
|
|
579
|
+
this._private_ensureRGBUpdatedFromHSL();
|
|
580
|
+
return new UIColor(this._private_rInternal, this._private_gInternal, this._private_bInternal, this._private_aInternal);
|
|
581
|
+
}
|
|
582
|
+
/** @internal */
|
|
583
|
+
_private_ensureRGBUpdatedFromHSL() {
|
|
584
|
+
if (this._private_rgbDirty) {
|
|
585
|
+
const { _private_hInternal: h, _private_sInternal: s, _private_lInternal: l } = this;
|
|
586
|
+
const c = (1 - Math.abs(2 * l - 1)) * s;
|
|
587
|
+
const hp = h / 60;
|
|
588
|
+
const x = c * (1 - Math.abs((hp % 2) - 1));
|
|
589
|
+
let [r, g, b] = hp < 1
|
|
590
|
+
? [c, x, 0]
|
|
591
|
+
: hp < 2
|
|
592
|
+
? [x, c, 0]
|
|
593
|
+
: hp < 3
|
|
594
|
+
? [0, c, x]
|
|
595
|
+
: hp < 4
|
|
596
|
+
? [0, x, c]
|
|
597
|
+
: hp < 5
|
|
598
|
+
? [x, 0, c]
|
|
599
|
+
: [c, 0, x];
|
|
600
|
+
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;
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
_private_ensureHSLUpdatedFromRGB() {
|
|
608
|
+
if (this._private_hslDirty) {
|
|
609
|
+
const { _private_rInternal: r, _private_gInternal: g, _private_bInternal: b } = this;
|
|
610
|
+
const max = Math.max(r, g, b);
|
|
611
|
+
const min = Math.min(r, g, b);
|
|
612
|
+
const d = max - min;
|
|
613
|
+
const l = (max + min) / 2;
|
|
614
|
+
let h = 0;
|
|
615
|
+
if (d !== 0) {
|
|
616
|
+
if (max === r) {
|
|
617
|
+
h = (g - b) / d + (g < b ? 6 : 0);
|
|
618
|
+
}
|
|
619
|
+
else if (max === g) {
|
|
620
|
+
h = (b - r) / d + 2;
|
|
621
|
+
}
|
|
622
|
+
else {
|
|
623
|
+
h = (r - g) / d + 4;
|
|
624
|
+
}
|
|
625
|
+
h *= 60;
|
|
626
|
+
}
|
|
627
|
+
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;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
export { UIColor };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Matrix4 } from "three";
|
|
2
|
+
import { UIMicroAnchorMode } from "../miscellaneous/micro/UIMicro.Internal";
|
|
3
|
+
/**
|
|
4
|
+
* Computes element transform matrix.
|
|
5
|
+
* @returns Transform matrix (reused, do not store reference)
|
|
6
|
+
*/
|
|
7
|
+
export declare function computeTransformMatrix(x: number, y: number, width: number, height: number, zIndex: number, microX: number, microY: number, microAnchorX: number, microAnchorY: number, microScaleX: number, microScaleY: number, microRotation: number, microAnchorMode: UIMicroAnchorMode): Matrix4;
|
|
8
|
+
/**
|
|
9
|
+
* Computes transform matrix for trimmed sprite.
|
|
10
|
+
* @param width Source width including trimmed areas
|
|
11
|
+
* @param height Source height including trimmed areas
|
|
12
|
+
* @param trimLeft Pixels trimmed from left
|
|
13
|
+
* @param trimRight Pixels trimmed from right
|
|
14
|
+
* @param trimTop Pixels trimmed from top
|
|
15
|
+
* @param trimBottom Pixels trimmed from bottom
|
|
16
|
+
* @returns Transform matrix (reused, do not store reference)
|
|
17
|
+
*/
|
|
18
|
+
export declare function computeTrimmedTransformMatrix(x: number, y: number, width: number, height: number, zIndex: number, microX: number, microY: number, microAnchorX: number, microAnchorY: number, microScaleX: number, microScaleY: number, microRotation: number, microAnchorMode: UIMicroAnchorMode, trimLeft: number, trimRight: number, trimTop: number, trimBottom: number): Matrix4;
|