@nativescript/core 9.0.12-next.0 → 9.0.12-next.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/LICENSE +19 -0
- package/abortcontroller/abortsignal.d.ts +23 -0
- package/abortcontroller/abortsignal.js +57 -0
- package/abortcontroller/abortsignal.js.map +1 -0
- package/abortcontroller/index.d.ts +20 -0
- package/abortcontroller/index.js +52 -0
- package/abortcontroller/index.js.map +1 -0
- package/accessibility/accessibility-common.d.ts +282 -0
- package/accessibility/accessibility-common.js +416 -0
- package/accessibility/accessibility-common.js.map +1 -0
- package/accessibility/accessibility-properties.d.ts +24 -0
- package/accessibility/accessibility-properties.js +118 -0
- package/accessibility/accessibility-properties.js.map +1 -0
- package/accessibility/index.d.ts +1 -0
- package/accessibility/index.js +2 -0
- package/accessibility/index.js.map +1 -0
- package/animation-frame/animation-native.android.d.ts +1 -0
- package/animation-frame/animation-native.android.js +4 -0
- package/animation-frame/animation-native.android.js.map +1 -0
- package/animation-frame/animation-native.ios.d.ts +1 -0
- package/animation-frame/animation-native.ios.js +3 -0
- package/animation-frame/animation-native.ios.js.map +1 -0
- package/animation-frame/index.js +81 -0
- package/animation-frame/index.js.map +1 -0
- package/application/application-common.d.ts +247 -0
- package/application/application-common.js +578 -0
- package/application/application-common.js.map +1 -0
- package/application/application-interfaces.d.ts +220 -0
- package/application/application-interfaces.js +2 -0
- package/application/application-interfaces.js.map +1 -0
- package/application/application-shims.d.ts +378 -0
- package/application/application-shims.js +380 -0
- package/application/application-shims.js.map +1 -0
- package/application/application.android.d.ts +81 -0
- package/application/application.android.js +1233 -0
- package/application/application.android.js.map +1 -0
- package/application/application.ios.d.ts +145 -0
- package/application/application.ios.js +1481 -0
- package/application/application.ios.js.map +1 -0
- package/application/helpers-common.d.ts +50 -0
- package/application/helpers-common.js +153 -0
- package/application/helpers-common.js.map +1 -0
- package/application/helpers.android.d.ts +8 -0
- package/application/helpers.android.js +119 -0
- package/application/helpers.android.js.map +1 -0
- package/application/helpers.ios.d.ts +8 -0
- package/application/helpers.ios.js +24 -0
- package/application/helpers.ios.js.map +1 -0
- package/application/index.android.d.ts +2 -0
- package/application/index.android.js +3 -0
- package/application/index.android.js.map +1 -0
- package/application/index.ios.d.ts +2 -0
- package/application/index.ios.js +3 -0
- package/application/index.ios.js.map +1 -0
- package/application-settings/application-settings-common.d.ts +2 -0
- package/application-settings/application-settings-common.js +15 -0
- package/application-settings/application-settings-common.js.map +1 -0
- package/application-settings/index.android.d.ts +11 -0
- package/application-settings/index.android.js +124 -0
- package/application-settings/index.android.js.map +1 -0
- package/application-settings/index.ios.d.ts +11 -0
- package/application-settings/index.ios.js +81 -0
- package/application-settings/index.ios.js.map +1 -0
- package/bundle-entry-points.d.ts +1 -0
- package/bundle-entry-points.js +47 -0
- package/bundle-entry-points.js.map +1 -0
- package/color/color-common.d.ts +136 -0
- package/color/color-common.js +341 -0
- package/color/color-common.js.map +1 -0
- package/color/color-types.d.ts +49 -0
- package/color/color-types.js +3 -0
- package/color/color-types.js.map +1 -0
- package/color/color-utils.d.ts +38 -0
- package/color/color-utils.js +213 -0
- package/color/color-utils.js.map +1 -0
- package/color/index.android.d.ts +4 -0
- package/color/index.android.js +7 -0
- package/color/index.android.js.map +1 -0
- package/color/index.ios.d.ts +7 -0
- package/color/index.ios.js +19 -0
- package/color/index.ios.js.map +1 -0
- package/color/known-colors.d.ts +144 -0
- package/color/known-colors.js +165 -0
- package/color/known-colors.js.map +1 -0
- package/config/config.interface.d.ts +297 -0
- package/config/config.interface.js +2 -0
- package/config/config.interface.js.map +1 -0
- package/config/index.d.ts +1 -0
- package/config/index.js +2 -0
- package/config/index.js.map +1 -0
- package/connectivity/index.android.d.ts +11 -0
- package/connectivity/index.android.js +157 -0
- package/connectivity/index.android.js.map +1 -0
- package/connectivity/index.ios.d.ts +11 -0
- package/connectivity/index.ios.js +132 -0
- package/connectivity/index.ios.js.map +1 -0
- package/console/index.d.ts +14 -0
- package/console/index.js +33 -0
- package/console/index.js.map +1 -0
- package/core-types/animation-types.d.ts +11 -0
- package/core-types/animation-types.js +13 -0
- package/core-types/animation-types.js.map +1 -0
- package/core-types/index.d.ts +345 -0
- package/core-types/index.js +290 -0
- package/core-types/index.js.map +1 -0
- package/core-types/validators.d.ts +2 -0
- package/core-types/validators.js +27 -0
- package/core-types/validators.js.map +1 -0
- package/css/CSS3Parser.d.ts +184 -0
- package/css/CSS3Parser.js +534 -0
- package/css/CSS3Parser.js.map +1 -0
- package/css/CSSNativeScript.d.ts +14 -0
- package/css/CSSNativeScript.js +113 -0
- package/css/CSSNativeScript.js.map +1 -0
- package/css/css-tree-parser.d.ts +1 -0
- package/css/css-tree-parser.js +133 -0
- package/css/css-tree-parser.js.map +1 -0
- package/css/lib/parse/index.d.ts +1 -0
- package/css/lib/parse/index.js +500 -0
- package/css/lib/parse/index.js.map +1 -0
- package/css/parser.d.ts +70 -0
- package/css/parser.js +517 -0
- package/css/parser.js.map +1 -0
- package/css/reworkcss.d.ts +44 -0
- package/css/reworkcss.js +5 -0
- package/css/reworkcss.js.map +1 -0
- package/css/system-classes.d.ts +12 -0
- package/css/system-classes.js +47 -0
- package/css/system-classes.js.map +1 -0
- package/css-mediaquery/index.d.ts +27 -0
- package/css-mediaquery/index.js +118 -0
- package/css-mediaquery/index.js.map +1 -0
- package/css-value/reworkcss-value.d.ts +31 -0
- package/css-value/reworkcss-value.js +91 -0
- package/css-value/reworkcss-value.js.map +1 -0
- package/data/observable/index.d.ts +213 -0
- package/data/observable/index.js +452 -0
- package/data/observable/index.js.map +1 -0
- package/data/observable-array/index.d.ts +215 -0
- package/data/observable-array/index.js +325 -0
- package/data/observable-array/index.js.map +1 -0
- package/data/virtual-array/index.d.ts +72 -0
- package/data/virtual-array/index.js +133 -0
- package/data/virtual-array/index.js.map +1 -0
- package/debugger/InspectorBackendCommands.d.ts +1056 -0
- package/debugger/InspectorBackendCommands.js +578 -0
- package/debugger/InspectorBackendCommands.js.map +1 -0
- package/debugger/devtools-elements-interfaces.d.ts +16 -0
- package/debugger/devtools-elements-interfaces.js +2 -0
- package/debugger/devtools-elements-interfaces.js.map +1 -0
- package/debugger/devtools-elements.common.d.ts +7 -0
- package/debugger/devtools-elements.common.js +93 -0
- package/debugger/devtools-elements.common.js.map +1 -0
- package/debugger/devtools-elements.js +20 -0
- package/debugger/devtools-elements.js.map +1 -0
- package/debugger/dom-types.d.ts +24 -0
- package/debugger/dom-types.js +152 -0
- package/debugger/dom-types.js.map +1 -0
- package/debugger/index.d.ts +87 -0
- package/debugger/index.js +118 -0
- package/debugger/index.js.map +1 -0
- package/debugger/webinspector-css.d.ts +34 -0
- package/debugger/webinspector-css.js +72 -0
- package/debugger/webinspector-css.js.map +1 -0
- package/debugger/webinspector-dom.d.ts +33 -0
- package/debugger/webinspector-dom.js +75 -0
- package/debugger/webinspector-dom.js.map +1 -0
- package/debugger/webinspector-network.android.d.ts +79 -0
- package/debugger/webinspector-network.android.js +208 -0
- package/debugger/webinspector-network.android.js.map +1 -0
- package/debugger/webinspector-network.ios.d.ts +79 -0
- package/debugger/webinspector-network.ios.js +204 -0
- package/debugger/webinspector-network.ios.js.map +1 -0
- package/fetch/index.d.ts +72 -0
- package/fetch/index.js +529 -0
- package/fetch/index.js.map +1 -0
- package/file-system/file-system-access.android.d.ts +151 -0
- package/file-system/file-system-access.android.js +1162 -0
- package/file-system/file-system-access.android.js.map +1 -0
- package/file-system/file-system-access.ios.d.ts +85 -0
- package/file-system/file-system-access.ios.js +622 -0
- package/file-system/file-system-access.ios.js.map +1 -0
- package/file-system/index.js +873 -0
- package/file-system/index.js.map +1 -0
- package/fps-meter/fps-native.android.d.ts +11 -0
- package/fps-meter/fps-native.android.js +62 -0
- package/fps-meter/fps-native.android.js.map +1 -0
- package/fps-meter/fps-native.ios.d.ts +10 -0
- package/fps-meter/fps-native.ios.js +56 -0
- package/fps-meter/fps-native.ios.js.map +1 -0
- package/fps-meter/index.js +77 -0
- package/fps-meter/index.js.map +1 -0
- package/globals/global-utils.d.ts +27 -0
- package/globals/global-utils.js +67 -0
- package/globals/global-utils.js.map +1 -0
- package/globals/index.d.ts +3 -0
- package/globals/index.js +313 -0
- package/globals/index.js.map +1 -0
- package/http/http-interfaces.d.ts +84 -0
- package/http/http-interfaces.js +6 -0
- package/http/http-interfaces.js.map +1 -0
- package/http/http-request/http-request-common.d.ts +1 -0
- package/http/http-request/http-request-common.js +15 -0
- package/http/http-request/http-request-common.js.map +1 -0
- package/http/http-request/index.android.d.ts +3 -0
- package/http/http-request/index.android.js +274 -0
- package/http/http-request/index.android.js.map +1 -0
- package/http/http-request/index.ios.d.ts +3 -0
- package/http/http-request/index.ios.js +221 -0
- package/http/http-request/index.ios.js.map +1 -0
- package/http/http-shared.d.ts +3 -0
- package/http/http-shared.js +2 -0
- package/http/http-shared.js.map +1 -0
- package/http/index.js +70 -0
- package/http/index.js.map +1 -0
- package/image-asset/image-asset-common.d.ts +25 -0
- package/image-asset/image-asset-common.js +74 -0
- package/image-asset/image-asset-common.js.map +1 -0
- package/image-asset/index.android.d.ts +9 -0
- package/image-asset/index.android.js +33 -0
- package/image-asset/index.android.js.map +1 -0
- package/image-asset/index.ios.d.ts +10 -0
- package/image-asset/index.ios.js +57 -0
- package/image-asset/index.ios.js.map +1 -0
- package/image-source/image-source-common.d.ts +4 -0
- package/image-source/image-source-common.js +21 -0
- package/image-source/image-source-common.js.map +1 -0
- package/image-source/index.android.d.ts +58 -0
- package/image-source/index.android.js +371 -0
- package/image-source/index.android.js.map +1 -0
- package/image-source/index.ios.d.ts +59 -0
- package/image-source/index.ios.js +454 -0
- package/image-source/index.ios.js.map +1 -0
- package/index.js +38 -0
- package/index.js.map +1 -0
- package/inspector_modules.d.ts +7 -0
- package/inspector_modules.js +233 -0
- package/inspector_modules.js.map +1 -0
- package/matrix/index.js +45 -0
- package/matrix/index.js.map +1 -0
- package/media-query-list/index.d.ts +21 -0
- package/media-query-list/index.js +159 -0
- package/media-query-list/index.js.map +1 -0
- package/module-name-resolver/helpers.d.ts +14 -0
- package/module-name-resolver/helpers.js +27 -0
- package/module-name-resolver/helpers.js.map +1 -0
- package/module-name-resolver/index.d.ts +14 -0
- package/module-name-resolver/index.js +67 -0
- package/module-name-resolver/index.js.map +1 -0
- package/module-name-resolver/non-bundle-workflow-compat.d.ts +6 -0
- package/module-name-resolver/non-bundle-workflow-compat.js +128 -0
- package/module-name-resolver/non-bundle-workflow-compat.js.map +1 -0
- package/module-name-resolver/qualifier-matcher/index.d.ts +11 -0
- package/module-name-resolver/qualifier-matcher/index.js +141 -0
- package/module-name-resolver/qualifier-matcher/index.js.map +1 -0
- package/package.json +86 -86
- package/platform/common.d.ts +10 -0
- package/platform/common.js +14 -0
- package/platform/common.js.map +1 -0
- package/platform/device/index.android.d.ts +20 -0
- package/platform/device/index.android.js +78 -0
- package/platform/device/index.android.js.map +1 -0
- package/platform/device/index.ios.d.ts +19 -0
- package/platform/device/index.ios.js +69 -0
- package/platform/device/index.ios.js.map +1 -0
- package/platform/index.js +4 -0
- package/platform/index.js.map +1 -0
- package/platform/screen/index.android.d.ts +16 -0
- package/platform/screen/index.android.js +41 -0
- package/platform/screen/index.android.js.map +1 -0
- package/platform/screen/index.ios.d.ts +15 -0
- package/platform/screen/index.ios.js +35 -0
- package/platform/screen/index.ios.js.map +1 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Headers/NSCCrypto.h +79 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Headers/NSCWinterTC.h +20 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Headers/NSString+WinterTC.h +21 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Modules/module.modulemap +6 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Resources/Info.plist +52 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Versions/Current/Headers/NSCCrypto.h +79 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Versions/Current/Headers/NSCWinterTC.h +20 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Versions/Current/Headers/NSString+WinterTC.h +21 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Versions/Current/Modules/module.modulemap +6 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Versions/Current/NSCWinterTC +0 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Versions/Current/Resources/Info.plist +52 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/NSCCrypto.h +60 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/NSData+Async.h +24 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/NSFileHandle+Async.h +22 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/NSString+Async.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/TNSLabel.h +16 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/TNSProcess.h +29 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/TNSWidgets.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/UIImage+TNSBlocks.h +26 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/UIView+PassThroughParent.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Modules/module.modulemap +6 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/PrivateHeaders/NSObject+Swizzling.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/PrivateHeaders/UIView+PropertyBag.h +18 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Resources/Info.plist +52 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Headers/NSCCrypto.h +60 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Headers/NSData+Async.h +24 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Headers/NSFileHandle+Async.h +22 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Headers/NSString+Async.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Headers/TNSLabel.h +16 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Headers/TNSProcess.h +29 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Headers/TNSWidgets.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Headers/UIImage+TNSBlocks.h +26 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Headers/UIView+PassThroughParent.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Modules/module.modulemap +6 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/PrivateHeaders/NSObject+Swizzling.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/PrivateHeaders/UIView+PropertyBag.h +18 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Resources/Info.plist +52 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/TNSWidgets +0 -0
- package/profiling/index.js +273 -0
- package/profiling/index.js.map +1 -0
- package/text/formatted-string.js +2 -0
- package/text/formatted-string.js.map +1 -0
- package/text/index.android.d.ts +9 -0
- package/text/index.android.js +11 -0
- package/text/index.android.js.map +1 -0
- package/text/index.ios.d.ts +9 -0
- package/text/index.ios.js +11 -0
- package/text/index.ios.js.map +1 -0
- package/text/span.js +2 -0
- package/text/span.js.map +1 -0
- package/text/text-common.d.ts +12 -0
- package/text/text-common.js +111 -0
- package/text/text-common.js.map +1 -0
- package/timer/index.android.d.ts +4 -0
- package/timer/index.android.js +83 -0
- package/timer/index.android.js.map +1 -0
- package/timer/index.ios.d.ts +4 -0
- package/timer/index.ios.js +68 -0
- package/timer/index.ios.js.map +1 -0
- package/trace/index.js +255 -0
- package/trace/index.js.map +1 -0
- package/ui/action-bar/action-bar-common.d.ts +85 -0
- package/ui/action-bar/action-bar-common.js +381 -0
- package/ui/action-bar/action-bar-common.js.map +1 -0
- package/ui/action-bar/index.android.d.ts +55 -0
- package/ui/action-bar/index.android.js +502 -0
- package/ui/action-bar/index.android.js.map +1 -0
- package/ui/action-bar/index.ios.d.ts +64 -0
- package/ui/action-bar/index.ios.js +614 -0
- package/ui/action-bar/index.ios.js.map +1 -0
- package/ui/activity-indicator/activity-indicator-common.d.ts +9 -0
- package/ui/activity-indicator/activity-indicator-common.js +22 -0
- package/ui/activity-indicator/activity-indicator-common.js.map +1 -0
- package/ui/activity-indicator/index.android.d.ts +15 -0
- package/ui/activity-indicator/index.android.js +54 -0
- package/ui/activity-indicator/index.android.js.map +1 -0
- package/ui/activity-indicator/index.ios.d.ts +16 -0
- package/ui/activity-indicator/index.ios.js +54 -0
- package/ui/activity-indicator/index.ios.js.map +1 -0
- package/ui/animation/animation-common.d.ts +30 -0
- package/ui/animation/animation-common.js +239 -0
- package/ui/animation/animation-common.js.map +1 -0
- package/ui/animation/animation-shared.d.ts +84 -0
- package/ui/animation/animation-shared.js +4 -0
- package/ui/animation/animation-shared.js.map +1 -0
- package/ui/animation/animation-types.d.ts +1 -0
- package/ui/animation/animation-types.js +3 -0
- package/ui/animation/animation-types.js.map +1 -0
- package/ui/animation/index.android.d.ts +23 -0
- package/ui/animation/index.android.js +432 -0
- package/ui/animation/index.android.js.map +1 -0
- package/ui/animation/index.ios.d.ts +28 -0
- package/ui/animation/index.ios.js +808 -0
- package/ui/animation/index.ios.js.map +1 -0
- package/ui/animation/keyframe-animation.d.ts +76 -0
- package/ui/animation/keyframe-animation.js +238 -0
- package/ui/animation/keyframe-animation.js.map +1 -0
- package/ui/builder/binding-builder.d.ts +13 -0
- package/ui/builder/binding-builder.js +171 -0
- package/ui/builder/binding-builder.js.map +1 -0
- package/ui/builder/component-builder/index.d.ts +7 -0
- package/ui/builder/component-builder/index.js +219 -0
- package/ui/builder/component-builder/index.js.map +1 -0
- package/ui/builder/index.d.ts +193 -0
- package/ui/builder/index.js +643 -0
- package/ui/builder/index.js.map +1 -0
- package/ui/button/button-common.d.ts +9 -0
- package/ui/button/button-common.js +26 -0
- package/ui/button/button-common.js.map +1 -0
- package/ui/button/index.android.d.ts +29 -0
- package/ui/button/index.android.js +166 -0
- package/ui/button/index.android.js.map +1 -0
- package/ui/button/index.ios.d.ts +37 -0
- package/ui/button/index.ios.js +316 -0
- package/ui/button/index.ios.js.map +1 -0
- package/ui/content-view/index.js +87 -0
- package/ui/content-view/index.js.map +1 -0
- package/ui/core/bindable/bindable-expressions.d.ts +7 -0
- package/ui/core/bindable/bindable-expressions.js +255 -0
- package/ui/core/bindable/bindable-expressions.js.map +1 -0
- package/ui/core/bindable/bindable-resources.d.ts +2 -0
- package/ui/core/bindable/bindable-resources.js +8 -0
- package/ui/core/bindable/bindable-resources.js.map +1 -0
- package/ui/core/bindable/bindable-types.d.ts +37 -0
- package/ui/core/bindable/bindable-types.js +3 -0
- package/ui/core/bindable/bindable-types.js.map +1 -0
- package/ui/core/bindable/index.d.ts +53 -0
- package/ui/core/bindable/index.js +555 -0
- package/ui/core/bindable/index.js.map +1 -0
- package/ui/core/control-state-change/index.android.d.ts +6 -0
- package/ui/core/control-state-change/index.android.js +8 -0
- package/ui/core/control-state-change/index.android.js.map +1 -0
- package/ui/core/control-state-change/index.ios.d.ts +10 -0
- package/ui/core/control-state-change/index.ios.js +43 -0
- package/ui/core/control-state-change/index.ios.js.map +1 -0
- package/ui/core/properties/index.d.ts +114 -0
- package/ui/core/properties/index.js +1290 -0
- package/ui/core/properties/index.js.map +1 -0
- package/ui/core/properties/property-shared.d.ts +35 -0
- package/ui/core/properties/property-shared.js +16 -0
- package/ui/core/properties/property-shared.js.map +1 -0
- package/ui/core/view/index.android.d.ts +144 -0
- package/ui/core/view/index.android.js +1576 -0
- package/ui/core/view/index.android.js.map +1 -0
- package/ui/core/view/index.ios.d.ts +151 -0
- package/ui/core/view/index.ios.js +1091 -0
- package/ui/core/view/index.ios.js.map +1 -0
- package/ui/core/view/view-common.d.ts +349 -0
- package/ui/core/view/view-common.js +1147 -0
- package/ui/core/view/view-common.js.map +1 -0
- package/ui/core/view/view-helper/index.android.d.ts +9 -0
- package/ui/core/view/view-helper/index.android.js +56 -0
- package/ui/core/view/view-helper/index.android.js.map +1 -0
- package/ui/core/view/view-helper/index.ios.d.ts +67 -0
- package/ui/core/view/view-helper/index.ios.js +414 -0
- package/ui/core/view/view-helper/index.ios.js.map +1 -0
- package/ui/core/view/view-helper/view-helper-common.d.ts +11 -0
- package/ui/core/view/view-helper/view-helper-common.js +166 -0
- package/ui/core/view/view-helper/view-helper-common.js.map +1 -0
- package/ui/core/view/view-helper/view-helper-shared.d.ts +5 -0
- package/ui/core/view/view-helper/view-helper-shared.js +6 -0
- package/ui/core/view/view-helper/view-helper-shared.js.map +1 -0
- package/ui/core/view/view-interfaces.d.ts +76 -0
- package/ui/core/view/view-interfaces.js +2 -0
- package/ui/core/view/view-interfaces.js.map +1 -0
- package/ui/core/view-base/index.d.ts +597 -0
- package/ui/core/view-base/index.js +1154 -0
- package/ui/core/view-base/index.js.map +1 -0
- package/ui/core/view-base/utils.d.ts +1 -0
- package/ui/core/view-base/utils.js +9 -0
- package/ui/core/view-base/utils.js.map +1 -0
- package/ui/core/weak-event-listener/index.js +123 -0
- package/ui/core/weak-event-listener/index.js.map +1 -0
- package/ui/date-picker/date-picker-common.d.ts +28 -0
- package/ui/date-picker/date-picker-common.js +82 -0
- package/ui/date-picker/date-picker-common.js.map +1 -0
- package/ui/date-picker/index.android.d.ts +19 -0
- package/ui/date-picker/index.android.js +131 -0
- package/ui/date-picker/index.android.js.map +1 -0
- package/ui/date-picker/index.ios.d.ts +27 -0
- package/ui/date-picker/index.ios.js +165 -0
- package/ui/date-picker/index.ios.js.map +1 -0
- package/ui/dialogs/dialogs-common.d.ts +211 -0
- package/ui/dialogs/dialogs-common.js +167 -0
- package/ui/dialogs/dialogs-common.js.map +1 -0
- package/ui/dialogs/index.android.d.ts +20 -0
- package/ui/dialogs/index.android.js +330 -0
- package/ui/dialogs/index.android.js.map +1 -0
- package/ui/dialogs/index.ios.d.ts +17 -0
- package/ui/dialogs/index.ios.js +293 -0
- package/ui/dialogs/index.ios.js.map +1 -0
- package/ui/editable-text-base/editable-text-base-common.d.ts +36 -0
- package/ui/editable-text-base/editable-text-base-common.js +91 -0
- package/ui/editable-text-base/editable-text-base-common.js.map +1 -0
- package/ui/editable-text-base/index.android.d.ts +48 -0
- package/ui/editable-text-base/index.android.js +497 -0
- package/ui/editable-text-base/index.android.js.map +1 -0
- package/ui/editable-text-base/index.ios.d.ts +20 -0
- package/ui/editable-text-base/index.ios.js +255 -0
- package/ui/editable-text-base/index.ios.js.map +1 -0
- package/ui/embedding/index.android.d.ts +4 -0
- package/ui/embedding/index.android.js +14 -0
- package/ui/embedding/index.android.js.map +1 -0
- package/ui/embedding/index.ios.d.ts +1 -0
- package/ui/embedding/index.ios.js +4 -0
- package/ui/embedding/index.ios.js.map +1 -0
- package/ui/enums/enums.js +6 -0
- package/ui/enums/enums.js.map +1 -0
- package/ui/enums/index.js +6 -0
- package/ui/enums/index.js.map +1 -0
- package/ui/frame/activity.android.d.ts +1 -0
- package/ui/frame/activity.android.js +110 -0
- package/ui/frame/activity.android.js.map +1 -0
- package/ui/frame/fragment.android.d.ts +3 -0
- package/ui/frame/fragment.android.js +90 -0
- package/ui/frame/fragment.android.js.map +1 -0
- package/ui/frame/fragment.ios.d.ts +3 -0
- package/ui/frame/fragment.ios.js +4 -0
- package/ui/frame/fragment.ios.js.map +1 -0
- package/ui/frame/fragment.transitions.android.d.ts +40 -0
- package/ui/frame/fragment.transitions.android.js +679 -0
- package/ui/frame/fragment.transitions.android.js.map +1 -0
- package/ui/frame/fragment.transitions.types.d.ts +6 -0
- package/ui/frame/fragment.transitions.types.js +2 -0
- package/ui/frame/fragment.transitions.types.js.map +1 -0
- package/ui/frame/frame-common.d.ts +101 -0
- package/ui/frame/frame-common.js +688 -0
- package/ui/frame/frame-common.js.map +1 -0
- package/ui/frame/frame-helper-for-android.d.ts +37 -0
- package/ui/frame/frame-helper-for-android.js +337 -0
- package/ui/frame/frame-helper-for-android.js.map +1 -0
- package/ui/frame/frame-helpers.d.ts +16 -0
- package/ui/frame/frame-helpers.js +19 -0
- package/ui/frame/frame-helpers.js.map +1 -0
- package/ui/frame/frame-interfaces.d.ts +130 -0
- package/ui/frame/frame-interfaces.js +7 -0
- package/ui/frame/frame-interfaces.js.map +1 -0
- package/ui/frame/frame-stack.d.ts +7 -0
- package/ui/frame/frame-stack.js +41 -0
- package/ui/frame/frame-stack.js.map +1 -0
- package/ui/frame/index.android.d.ts +93 -0
- package/ui/frame/index.android.js +977 -0
- package/ui/frame/index.android.js.map +1 -0
- package/ui/frame/index.ios.d.ts +61 -0
- package/ui/frame/index.ios.js +728 -0
- package/ui/frame/index.ios.js.map +1 -0
- package/ui/gestures/gestures-common.d.ts +32 -0
- package/ui/gestures/gestures-common.js +78 -0
- package/ui/gestures/gestures-common.js.map +1 -0
- package/ui/gestures/gestures-types.d.ts +108 -0
- package/ui/gestures/gestures-types.js +40 -0
- package/ui/gestures/gestures-types.js.map +1 -0
- package/ui/gestures/index.android.d.ts +49 -0
- package/ui/gestures/index.android.js +596 -0
- package/ui/gestures/index.android.js.map +1 -0
- package/ui/gestures/index.ios.d.ts +70 -0
- package/ui/gestures/index.ios.js +510 -0
- package/ui/gestures/index.ios.js.map +1 -0
- package/ui/gestures/touch-manager.d.ts +82 -0
- package/ui/gestures/touch-manager.js +268 -0
- package/ui/gestures/touch-manager.js.map +1 -0
- package/ui/html-view/html-view-common.d.ts +12 -0
- package/ui/html-view/html-view-common.js +31 -0
- package/ui/html-view/html-view-common.js.map +1 -0
- package/ui/html-view/index.android.d.ts +27 -0
- package/ui/html-view/index.android.js +90 -0
- package/ui/html-view/index.android.js.map +1 -0
- package/ui/html-view/index.ios.d.ts +22 -0
- package/ui/html-view/index.ios.js +101 -0
- package/ui/html-view/index.ios.js.map +1 -0
- package/ui/image/image-common.d.ts +45 -0
- package/ui/image/image-common.js +195 -0
- package/ui/image/image-common.js.map +1 -0
- package/ui/image/index.android.d.ts +23 -0
- package/ui/image/index.android.js +171 -0
- package/ui/image/index.android.js.map +1 -0
- package/ui/image/index.ios.d.ts +26 -0
- package/ui/image/index.ios.js +186 -0
- package/ui/image/index.ios.js.map +1 -0
- package/ui/image/symbol-effects-common.d.ts +36 -0
- package/ui/image/symbol-effects-common.js +35 -0
- package/ui/image/symbol-effects-common.js.map +1 -0
- package/ui/image/symbol-effects.android.d.ts +5 -0
- package/ui/image/symbol-effects.android.js +8 -0
- package/ui/image/symbol-effects.android.js.map +1 -0
- package/ui/image/symbol-effects.ios.d.ts +6 -0
- package/ui/image/symbol-effects.ios.js +79 -0
- package/ui/image/symbol-effects.ios.js.map +1 -0
- package/ui/image-cache/image-cache-common.d.ts +40 -0
- package/ui/image-cache/image-cache-common.js +176 -0
- package/ui/image-cache/image-cache-common.js.map +1 -0
- package/ui/image-cache/index.android.d.ts +11 -0
- package/ui/image-cache/index.android.js +74 -0
- package/ui/image-cache/index.android.js.map +1 -0
- package/ui/image-cache/index.ios.d.ts +11 -0
- package/ui/image-cache/index.ios.js +78 -0
- package/ui/image-cache/index.ios.js.map +1 -0
- package/ui/index.d.ts +92 -0
- package/ui/index.js +80 -0
- package/ui/index.js.map +1 -0
- package/ui/label/index.android.d.ts +13 -0
- package/ui/label/index.android.js +47 -0
- package/ui/label/index.android.js.map +1 -0
- package/ui/label/index.ios.d.ts +31 -0
- package/ui/label/index.ios.js +234 -0
- package/ui/label/index.ios.js.map +1 -0
- package/ui/layouts/absolute-layout/absolute-layout-common.d.ts +16 -0
- package/ui/layouts/absolute-layout/absolute-layout-common.js +72 -0
- package/ui/layouts/absolute-layout/absolute-layout-common.js.map +1 -0
- package/ui/layouts/absolute-layout/index.android.d.ts +6 -0
- package/ui/layouts/absolute-layout/index.android.js +26 -0
- package/ui/layouts/absolute-layout/index.android.js.map +1 -0
- package/ui/layouts/absolute-layout/index.ios.d.ts +10 -0
- package/ui/layouts/absolute-layout/index.ios.js +48 -0
- package/ui/layouts/absolute-layout/index.ios.js.map +1 -0
- package/ui/layouts/dock-layout/dock-layout-common.d.ts +14 -0
- package/ui/layouts/dock-layout/dock-layout-common.js +51 -0
- package/ui/layouts/dock-layout/dock-layout-common.js.map +1 -0
- package/ui/layouts/dock-layout/index.android.d.ts +8 -0
- package/ui/layouts/dock-layout/index.android.js +38 -0
- package/ui/layouts/dock-layout/index.android.js.map +1 -0
- package/ui/layouts/dock-layout/index.ios.d.ts +8 -0
- package/ui/layouts/dock-layout/index.ios.js +115 -0
- package/ui/layouts/dock-layout/index.ios.js.map +1 -0
- package/ui/layouts/flexbox-layout/flexbox-layout-common.d.ts +126 -0
- package/ui/layouts/flexbox-layout/flexbox-layout-common.js +403 -0
- package/ui/layouts/flexbox-layout/flexbox-layout-common.js.map +1 -0
- package/ui/layouts/flexbox-layout/index.android.d.ts +23 -0
- package/ui/layouts/flexbox-layout/index.android.js +152 -0
- package/ui/layouts/flexbox-layout/index.android.js.map +1 -0
- package/ui/layouts/flexbox-layout/index.ios.d.ts +44 -0
- package/ui/layouts/flexbox-layout/index.ios.js +1241 -0
- package/ui/layouts/flexbox-layout/index.ios.js.map +1 -0
- package/ui/layouts/grid-layout/grid-layout-common.d.ts +72 -0
- package/ui/layouts/grid-layout/grid-layout-common.js +358 -0
- package/ui/layouts/grid-layout/grid-layout-common.js.map +1 -0
- package/ui/layouts/grid-layout/index.android.d.ts +23 -0
- package/ui/layouts/grid-layout/index.android.js +122 -0
- package/ui/layouts/grid-layout/index.android.js.map +1 -0
- package/ui/layouts/grid-layout/index.ios.d.ts +28 -0
- package/ui/layouts/grid-layout/index.ios.js +778 -0
- package/ui/layouts/grid-layout/index.ios.js.map +1 -0
- package/ui/layouts/index.d.ts +12 -0
- package/ui/layouts/index.js +11 -0
- package/ui/layouts/index.js.map +1 -0
- package/ui/layouts/layout-base-common.d.ts +36 -0
- package/ui/layouts/layout-base-common.js +141 -0
- package/ui/layouts/layout-base-common.js.map +1 -0
- package/ui/layouts/layout-base.android.d.ts +17 -0
- package/ui/layouts/layout-base.android.js +50 -0
- package/ui/layouts/layout-base.android.js.map +1 -0
- package/ui/layouts/layout-base.ios.d.ts +13 -0
- package/ui/layouts/layout-base.ios.js +40 -0
- package/ui/layouts/layout-base.ios.js.map +1 -0
- package/ui/layouts/liquid-glass/index.android.d.ts +5 -0
- package/ui/layouts/liquid-glass/index.android.js +8 -0
- package/ui/layouts/liquid-glass/index.android.js.map +1 -0
- package/ui/layouts/liquid-glass/index.ios.d.ts +10 -0
- package/ui/layouts/liquid-glass/index.ios.js +59 -0
- package/ui/layouts/liquid-glass/index.ios.js.map +1 -0
- package/ui/layouts/liquid-glass/liquid-glass-common.d.ts +3 -0
- package/ui/layouts/liquid-glass/liquid-glass-common.js +4 -0
- package/ui/layouts/liquid-glass/liquid-glass-common.js.map +1 -0
- package/ui/layouts/liquid-glass-container/index.android.d.ts +3 -0
- package/ui/layouts/liquid-glass-container/index.android.js +4 -0
- package/ui/layouts/liquid-glass-container/index.android.js.map +1 -0
- package/ui/layouts/liquid-glass-container/index.ios.d.ts +14 -0
- package/ui/layouts/liquid-glass-container/index.ios.js +121 -0
- package/ui/layouts/liquid-glass-container/index.ios.js.map +1 -0
- package/ui/layouts/liquid-glass-container/liquid-glass-container-common.d.ts +4 -0
- package/ui/layouts/liquid-glass-container/liquid-glass-container-common.js +5 -0
- package/ui/layouts/liquid-glass-container/liquid-glass-container-common.js.map +1 -0
- package/ui/layouts/root-layout/index.android.d.ts +15 -0
- package/ui/layouts/root-layout/index.android.js +126 -0
- package/ui/layouts/root-layout/index.android.js.map +1 -0
- package/ui/layouts/root-layout/index.ios.d.ts +17 -0
- package/ui/layouts/root-layout/index.ios.js +101 -0
- package/ui/layouts/root-layout/index.ios.js.map +1 -0
- package/ui/layouts/root-layout/root-layout-common.d.ts +61 -0
- package/ui/layouts/root-layout/root-layout-common.js +425 -0
- package/ui/layouts/root-layout/root-layout-common.js.map +1 -0
- package/ui/layouts/root-layout/root-layout-stack.d.ts +5 -0
- package/ui/layouts/root-layout/root-layout-stack.js +19 -0
- package/ui/layouts/root-layout/root-layout-stack.js.map +1 -0
- package/ui/layouts/stack-layout/index.android.d.ts +7 -0
- package/ui/layouts/stack-layout/index.android.js +11 -0
- package/ui/layouts/stack-layout/index.android.js.map +1 -0
- package/ui/layouts/stack-layout/index.ios.d.ts +10 -0
- package/ui/layouts/stack-layout/index.ios.js +155 -0
- package/ui/layouts/stack-layout/index.ios.js.map +1 -0
- package/ui/layouts/stack-layout/stack-layout-common.d.ts +8 -0
- package/ui/layouts/stack-layout/stack-layout-common.js +19 -0
- package/ui/layouts/stack-layout/stack-layout-common.js.map +1 -0
- package/ui/layouts/wrap-layout/index.android.d.ts +10 -0
- package/ui/layouts/wrap-layout/index.android.js +18 -0
- package/ui/layouts/wrap-layout/index.android.js.map +1 -0
- package/ui/layouts/wrap-layout/index.ios.d.ts +8 -0
- package/ui/layouts/wrap-layout/index.ios.js +170 -0
- package/ui/layouts/wrap-layout/index.ios.js.map +1 -0
- package/ui/layouts/wrap-layout/wrap-layout-common.d.ts +15 -0
- package/ui/layouts/wrap-layout/wrap-layout-common.js +40 -0
- package/ui/layouts/wrap-layout/wrap-layout-common.js.map +1 -0
- package/ui/list-picker/index.android.d.ts +18 -0
- package/ui/list-picker/index.android.js +177 -0
- package/ui/list-picker/index.android.js.map +1 -0
- package/ui/list-picker/index.ios.d.ts +19 -0
- package/ui/list-picker/index.ios.js +99 -0
- package/ui/list-picker/index.ios.js.map +1 -0
- package/ui/list-picker/list-picker-common.d.ts +23 -0
- package/ui/list-picker/list-picker-common.js +78 -0
- package/ui/list-picker/list-picker-common.js.map +1 -0
- package/ui/list-view/index.android.d.ts +68 -0
- package/ui/list-view/index.android.js +1005 -0
- package/ui/list-view/index.android.js.map +1 -0
- package/ui/list-view/index.ios.d.ts +84 -0
- package/ui/list-view/index.ios.js +996 -0
- package/ui/list-view/index.ios.js.map +1 -0
- package/ui/list-view/list-view-common.d.ts +87 -0
- package/ui/list-view/list-view-common.js +296 -0
- package/ui/list-view/list-view-common.js.map +1 -0
- package/ui/page/events.d.ts +6 -0
- package/ui/page/events.js +7 -0
- package/ui/page/events.js.map +1 -0
- package/ui/page/index.android.d.ts +16 -0
- package/ui/page/index.android.js +106 -0
- package/ui/page/index.android.js.map +1 -0
- package/ui/page/index.ios.d.ts +52 -0
- package/ui/page/index.ios.js +515 -0
- package/ui/page/index.ios.js.map +1 -0
- package/ui/page/page-common.d.ts +73 -0
- package/ui/page/page-common.js +191 -0
- package/ui/page/page-common.js.map +1 -0
- package/ui/placeholder/index.android.d.ts +12 -0
- package/ui/placeholder/index.android.js +21 -0
- package/ui/placeholder/index.android.js.map +1 -0
- package/ui/placeholder/index.js +16 -0
- package/ui/placeholder/index.js.map +1 -0
- package/ui/placeholder/placeholder-common.d.ts +11 -0
- package/ui/placeholder/placeholder-common.js +2 -0
- package/ui/placeholder/placeholder-common.js.map +1 -0
- package/ui/progress/index.android.d.ts +18 -0
- package/ui/progress/index.android.js +65 -0
- package/ui/progress/index.android.js.map +1 -0
- package/ui/progress/index.ios.d.ts +19 -0
- package/ui/progress/index.ios.js +45 -0
- package/ui/progress/index.ios.js.map +1 -0
- package/ui/progress/progress-common.d.ts +15 -0
- package/ui/progress/progress-common.js +34 -0
- package/ui/progress/progress-common.js.map +1 -0
- package/ui/proxy-view-container/index.d.ts +33 -0
- package/ui/proxy-view-container/index.js +247 -0
- package/ui/proxy-view-container/index.js.map +1 -0
- package/ui/repeater/index.d.ts +67 -0
- package/ui/repeater/index.js +225 -0
- package/ui/repeater/index.js.map +1 -0
- package/ui/scroll-view/index.android.d.ts +27 -0
- package/ui/scroll-view/index.android.js +157 -0
- package/ui/scroll-view/index.android.js.map +1 -0
- package/ui/scroll-view/index.ios.d.ts +29 -0
- package/ui/scroll-view/index.ios.js +193 -0
- package/ui/scroll-view/index.ios.js.map +1 -0
- package/ui/scroll-view/scroll-view-common.d.ts +27 -0
- package/ui/scroll-view/scroll-view-common.js +93 -0
- package/ui/scroll-view/scroll-view-common.js.map +1 -0
- package/ui/search-bar/index.android.d.ts +44 -0
- package/ui/search-bar/index.android.js +260 -0
- package/ui/search-bar/index.android.js.map +1 -0
- package/ui/search-bar/index.ios.d.ts +36 -0
- package/ui/search-bar/index.ios.js +203 -0
- package/ui/search-bar/index.ios.js.map +1 -0
- package/ui/search-bar/search-bar-common.d.ts +19 -0
- package/ui/search-bar/search-bar-common.js +43 -0
- package/ui/search-bar/search-bar-common.js.map +1 -0
- package/ui/segmented-bar/index.android.d.ts +42 -0
- package/ui/segmented-bar/index.android.js +280 -0
- package/ui/segmented-bar/index.android.js.map +1 -0
- package/ui/segmented-bar/index.ios.d.ts +28 -0
- package/ui/segmented-bar/index.ios.js +141 -0
- package/ui/segmented-bar/index.ios.js.map +1 -0
- package/ui/segmented-bar/segmented-bar-common.d.ts +37 -0
- package/ui/segmented-bar/segmented-bar-common.js +146 -0
- package/ui/segmented-bar/segmented-bar-common.js.map +1 -0
- package/ui/slider/index.android.d.ts +32 -0
- package/ui/slider/index.android.js +123 -0
- package/ui/slider/index.android.js.map +1 -0
- package/ui/slider/index.ios.d.ts +34 -0
- package/ui/slider/index.ios.js +145 -0
- package/ui/slider/index.ios.js.map +1 -0
- package/ui/slider/slider-common.d.ts +27 -0
- package/ui/slider/slider-common.js +69 -0
- package/ui/slider/slider-common.js.map +1 -0
- package/ui/split-view/index.android.d.ts +3 -0
- package/ui/split-view/index.android.js +4 -0
- package/ui/split-view/index.android.js.map +1 -0
- package/ui/split-view/index.ios.d.ts +51 -0
- package/ui/split-view/index.ios.js +567 -0
- package/ui/split-view/index.ios.js.map +1 -0
- package/ui/split-view/split-view-common.d.ts +59 -0
- package/ui/split-view/split-view-common.js +127 -0
- package/ui/split-view/split-view-common.js.map +1 -0
- package/ui/styling/background-common.d.ts +78 -0
- package/ui/styling/background-common.js +241 -0
- package/ui/styling/background-common.js.map +1 -0
- package/ui/styling/background.android.d.ts +3 -0
- package/ui/styling/background.android.js +82 -0
- package/ui/styling/background.android.js.map +1 -0
- package/ui/styling/background.ios.d.ts +21 -0
- package/ui/styling/background.ios.js +1105 -0
- package/ui/styling/background.ios.js.map +1 -0
- package/ui/styling/box-shadow.d.ts +9 -0
- package/ui/styling/box-shadow.js +3 -0
- package/ui/styling/box-shadow.js.map +1 -0
- package/ui/styling/clip-path-function.d.ts +16 -0
- package/ui/styling/clip-path-function.js +25 -0
- package/ui/styling/clip-path-function.js.map +1 -0
- package/ui/styling/converters.d.ts +2 -0
- package/ui/styling/converters.js +41 -0
- package/ui/styling/converters.js.map +1 -0
- package/ui/styling/css-animation-parser.d.ts +14 -0
- package/ui/styling/css-animation-parser.js +187 -0
- package/ui/styling/css-animation-parser.js.map +1 -0
- package/ui/styling/css-selector.d.ts +270 -0
- package/ui/styling/css-selector.js +934 -0
- package/ui/styling/css-selector.js.map +1 -0
- package/ui/styling/css-shadow.d.ts +19 -0
- package/ui/styling/css-shadow.js +26 -0
- package/ui/styling/css-shadow.js.map +1 -0
- package/ui/styling/css-stroke.d.ts +12 -0
- package/ui/styling/css-stroke.js +19 -0
- package/ui/styling/css-stroke.js.map +1 -0
- package/ui/styling/css-transform.d.ts +2 -0
- package/ui/styling/css-transform.js +110 -0
- package/ui/styling/css-transform.js.map +1 -0
- package/ui/styling/css-utils.d.ts +8 -0
- package/ui/styling/css-utils.js +73 -0
- package/ui/styling/css-utils.js.map +1 -0
- package/ui/styling/font-common.d.ts +62 -0
- package/ui/styling/font-common.js +195 -0
- package/ui/styling/font-common.js.map +1 -0
- package/ui/styling/font-interfaces.d.ts +16 -0
- package/ui/styling/font-interfaces.js +2 -0
- package/ui/styling/font-interfaces.js.map +1 -0
- package/ui/styling/font.android.d.ts +15 -0
- package/ui/styling/font.android.js +226 -0
- package/ui/styling/font.android.js.map +1 -0
- package/ui/styling/font.ios.d.ts +18 -0
- package/ui/styling/font.ios.js +159 -0
- package/ui/styling/font.ios.js.map +1 -0
- package/ui/styling/length-shared.d.ts +52 -0
- package/ui/styling/length-shared.js +173 -0
- package/ui/styling/length-shared.js.map +1 -0
- package/ui/styling/linear-gradient.d.ts +13 -0
- package/ui/styling/linear-gradient.js +48 -0
- package/ui/styling/linear-gradient.js.map +1 -0
- package/ui/styling/style/index.d.ts +166 -0
- package/ui/styling/style/index.js +67 -0
- package/ui/styling/style/index.js.map +1 -0
- package/ui/styling/style-properties.d.ts +63 -0
- package/ui/styling/style-properties.js +1151 -0
- package/ui/styling/style-properties.js.map +1 -0
- package/ui/styling/style-scope.d.ts +87 -0
- package/ui/styling/style-scope.js +1020 -0
- package/ui/styling/style-scope.js.map +1 -0
- package/ui/styling/styling-profile.d.ts +1 -0
- package/ui/styling/styling-profile.js +4 -0
- package/ui/styling/styling-profile.js.map +1 -0
- package/ui/styling/styling-shared.d.ts +3 -0
- package/ui/styling/styling-shared.js +6 -0
- package/ui/styling/styling-shared.js.map +1 -0
- package/ui/switch/index.android.d.ts +23 -0
- package/ui/switch/index.android.js +111 -0
- package/ui/switch/index.android.js.map +1 -0
- package/ui/switch/index.ios.d.ts +26 -0
- package/ui/switch/index.ios.js +185 -0
- package/ui/switch/index.ios.js.map +1 -0
- package/ui/switch/switch-common.d.ts +12 -0
- package/ui/switch/switch-common.js +37 -0
- package/ui/switch/switch-common.js.map +1 -0
- package/ui/tab-view/index.android.d.ts +73 -0
- package/ui/tab-view/index.android.js +646 -0
- package/ui/tab-view/index.android.js.map +1 -0
- package/ui/tab-view/index.ios.d.ts +80 -0
- package/ui/tab-view/index.ios.js +877 -0
- package/ui/tab-view/index.ios.js.map +1 -0
- package/ui/tab-view/tab-view-common.d.ts +86 -0
- package/ui/tab-view/tab-view-common.js +277 -0
- package/ui/tab-view/tab-view-common.js.map +1 -0
- package/ui/text-base/formatted-string.js +163 -0
- package/ui/text-base/formatted-string.js.map +1 -0
- package/ui/text-base/index.android.d.ts +79 -0
- package/ui/text-base/index.android.js +589 -0
- package/ui/text-base/index.android.js.map +1 -0
- package/ui/text-base/index.ios.d.ts +53 -0
- package/ui/text-base/index.ios.js +452 -0
- package/ui/text-base/index.ios.js.map +1 -0
- package/ui/text-base/span.js +113 -0
- package/ui/text-base/span.js.map +1 -0
- package/ui/text-base/text-base-common.d.ts +99 -0
- package/ui/text-base/text-base-common.js +324 -0
- package/ui/text-base/text-base-common.js.map +1 -0
- package/ui/text-field/index.android.d.ts +10 -0
- package/ui/text-field/index.android.js +92 -0
- package/ui/text-field/index.android.js.map +1 -0
- package/ui/text-field/index.ios.d.ts +56 -0
- package/ui/text-field/index.ios.js +315 -0
- package/ui/text-field/index.ios.js.map +1 -0
- package/ui/text-field/text-field-common.d.ts +11 -0
- package/ui/text-field/text-field-common.js +25 -0
- package/ui/text-field/text-field-common.js.map +1 -0
- package/ui/text-view/index.android.d.ts +8 -0
- package/ui/text-view/index.android.js +24 -0
- package/ui/text-view/index.android.js.map +1 -0
- package/ui/text-view/index.ios.d.ts +59 -0
- package/ui/text-view/index.ios.js +432 -0
- package/ui/text-view/index.ios.js.map +1 -0
- package/ui/text-view/text-view-common.d.ts +32 -0
- package/ui/text-view/text-view-common.js +39 -0
- package/ui/text-view/text-view-common.js.map +1 -0
- package/ui/time-picker/index.android.d.ts +10 -0
- package/ui/time-picker/index.android.js +79 -0
- package/ui/time-picker/index.android.js.map +1 -0
- package/ui/time-picker/index.ios.d.ts +31 -0
- package/ui/time-picker/index.ios.js +138 -0
- package/ui/time-picker/index.ios.js.map +1 -0
- package/ui/time-picker/time-picker-common.d.ts +31 -0
- package/ui/time-picker/time-picker-common.js +176 -0
- package/ui/time-picker/time-picker-common.js.map +1 -0
- package/ui/transition/fade-transition.android.d.ts +4 -0
- package/ui/transition/fade-transition.android.js +28 -0
- package/ui/transition/fade-transition.android.js.map +1 -0
- package/ui/transition/fade-transition.ios.d.ts +17 -0
- package/ui/transition/fade-transition.ios.js +64 -0
- package/ui/transition/fade-transition.ios.js.map +1 -0
- package/ui/transition/flip-transition.android.d.ts +6 -0
- package/ui/transition/flip-transition.android.js +90 -0
- package/ui/transition/flip-transition.android.js.map +1 -0
- package/ui/transition/index.android.d.ts +19 -0
- package/ui/transition/index.android.js +37 -0
- package/ui/transition/index.android.js.map +1 -0
- package/ui/transition/index.ios.d.ts +14 -0
- package/ui/transition/index.ios.js +30 -0
- package/ui/transition/index.ios.js.map +1 -0
- package/ui/transition/modal-transition.android.d.ts +5 -0
- package/ui/transition/modal-transition.android.js +7 -0
- package/ui/transition/modal-transition.android.js.map +1 -0
- package/ui/transition/modal-transition.ios.d.ts +34 -0
- package/ui/transition/modal-transition.ios.js +175 -0
- package/ui/transition/modal-transition.ios.js.map +1 -0
- package/ui/transition/page-transition.android.d.ts +9 -0
- package/ui/transition/page-transition.android.js +284 -0
- package/ui/transition/page-transition.android.js.map +1 -0
- package/ui/transition/page-transition.ios.d.ts +35 -0
- package/ui/transition/page-transition.ios.js +193 -0
- package/ui/transition/page-transition.ios.js.map +1 -0
- package/ui/transition/shared-transition-helper.android.d.ts +9 -0
- package/ui/transition/shared-transition-helper.android.js +10 -0
- package/ui/transition/shared-transition-helper.android.js.map +1 -0
- package/ui/transition/shared-transition-helper.ios.d.ts +14 -0
- package/ui/transition/shared-transition-helper.ios.js +539 -0
- package/ui/transition/shared-transition-helper.ios.js.map +1 -0
- package/ui/transition/shared-transition.d.ts +271 -0
- package/ui/transition/shared-transition.js +215 -0
- package/ui/transition/shared-transition.js.map +1 -0
- package/ui/transition/slide-transition.android.d.ts +7 -0
- package/ui/transition/slide-transition.android.js +116 -0
- package/ui/transition/slide-transition.android.js.map +1 -0
- package/ui/transition/slide-transition.ios.d.ts +19 -0
- package/ui/transition/slide-transition.ios.js +94 -0
- package/ui/transition/slide-transition.ios.js.map +1 -0
- package/ui/utils.android.d.ts +5 -0
- package/ui/utils.android.js +16 -0
- package/ui/utils.android.js.map +1 -0
- package/ui/utils.ios.d.ts +11 -0
- package/ui/utils.ios.js +66 -0
- package/ui/utils.ios.js.map +1 -0
- package/ui/web-view/index.android.d.ts +18 -0
- package/ui/web-view/index.android.js +173 -0
- package/ui/web-view/index.android.js.map +1 -0
- package/ui/web-view/index.ios.d.ts +27 -0
- package/ui/web-view/index.ios.js +246 -0
- package/ui/web-view/index.ios.js.map +1 -0
- package/ui/web-view/web-view-common.d.ts +30 -0
- package/ui/web-view/web-view-common.js +74 -0
- package/ui/web-view/web-view-common.js.map +1 -0
- package/ui/web-view/web-view-interfaces.d.ts +11 -0
- package/ui/web-view/web-view-interfaces.js +2 -0
- package/ui/web-view/web-view-interfaces.js.map +1 -0
- package/utils/animation-helpers.d.ts +27 -0
- package/utils/animation-helpers.js +48 -0
- package/utils/animation-helpers.js.map +1 -0
- package/utils/common.d.ts +28 -0
- package/utils/common.js +158 -0
- package/utils/common.js.map +1 -0
- package/utils/constants.android.d.ts +2 -0
- package/utils/constants.android.js +5 -0
- package/utils/constants.android.js.map +1 -0
- package/utils/constants.ios.d.ts +2 -0
- package/utils/constants.ios.js +5 -0
- package/utils/constants.ios.js.map +1 -0
- package/utils/debug-source.d.ts +19 -0
- package/utils/debug-source.js +78 -0
- package/utils/debug-source.js.map +1 -0
- package/utils/debug.js +3 -0
- package/utils/debug.js.map +1 -0
- package/utils/index.android.d.ts +26 -0
- package/utils/index.android.js +205 -0
- package/utils/index.android.js.map +1 -0
- package/utils/index.ios.d.ts +22 -0
- package/utils/index.ios.js +113 -0
- package/utils/index.ios.js.map +1 -0
- package/utils/layout-helper/index.android.d.ts +25 -0
- package/utils/layout-helper/index.android.js +86 -0
- package/utils/layout-helper/index.android.js.map +1 -0
- package/utils/layout-helper/index.ios.d.ts +25 -0
- package/utils/layout-helper/index.ios.js +68 -0
- package/utils/layout-helper/index.ios.js.map +1 -0
- package/utils/layout-helper/layout-helper-common.d.ts +5 -0
- package/utils/layout-helper/layout-helper-common.js +49 -0
- package/utils/layout-helper/layout-helper-common.js.map +1 -0
- package/utils/layout-helper/layout-helper-shared.d.ts +9 -0
- package/utils/layout-helper/layout-helper-shared.js +13 -0
- package/utils/layout-helper/layout-helper-shared.js.map +1 -0
- package/utils/lazy.js +5 -0
- package/utils/lazy.js.map +1 -0
- package/utils/macrotask-scheduler.js +26 -0
- package/utils/macrotask-scheduler.js.map +1 -0
- package/utils/mainthread-helper.android.d.ts +3 -0
- package/utils/mainthread-helper.android.js +28 -0
- package/utils/mainthread-helper.android.js.map +1 -0
- package/utils/mainthread-helper.ios.d.ts +3 -0
- package/utils/mainthread-helper.ios.js +17 -0
- package/utils/mainthread-helper.ios.js.map +1 -0
- package/utils/module-merge.d.ts +1 -0
- package/utils/module-merge.js +8 -0
- package/utils/module-merge.js.map +1 -0
- package/utils/native-helper-for-android.d.ts +45 -0
- package/utils/native-helper-for-android.js +376 -0
- package/utils/native-helper-for-android.js.map +1 -0
- package/utils/native-helper.android.d.ts +42 -0
- package/utils/native-helper.android.js +30 -0
- package/utils/native-helper.android.js.map +1 -0
- package/utils/native-helper.ios.d.ts +79 -0
- package/utils/native-helper.ios.js +339 -0
- package/utils/native-helper.ios.js.map +1 -0
- package/utils/number-utils.d.ts +19 -0
- package/utils/number-utils.js +37 -0
- package/utils/number-utils.js.map +1 -0
- package/utils/platform-check.d.ts +4 -0
- package/utils/platform-check.js +21 -0
- package/utils/platform-check.js.map +1 -0
- package/utils/shared.d.ts +17 -0
- package/utils/shared.js +40 -0
- package/utils/shared.js.map +1 -0
- package/utils/types.js +104 -0
- package/utils/types.js.map +1 -0
- package/utils/utils-shared.d.ts +1 -0
- package/utils/utils-shared.js +8 -0
- package/utils/utils-shared.js.map +1 -0
- package/wgc/atob.d.ts +1 -0
- package/wgc/atob.js +9 -0
- package/wgc/atob.js.map +1 -0
- package/wgc/btoa.d.ts +1 -0
- package/wgc/btoa.js +9 -0
- package/wgc/btoa.js.map +1 -0
- package/wgc/crypto/SubtleCrypto.d.ts +63 -0
- package/wgc/crypto/SubtleCrypto.js +551 -0
- package/wgc/crypto/SubtleCrypto.js.map +1 -0
- package/wgc/crypto/index.d.ts +8 -0
- package/wgc/crypto/index.js +32 -0
- package/wgc/crypto/index.js.map +1 -0
- package/wgc/index.d.ts +2 -0
- package/wgc/index.js +3 -0
- package/wgc/index.js.map +1 -0
- package/xhr/index.d.ts +113 -0
- package/xhr/index.js +486 -0
- package/xhr/index.js.map +1 -0
- package/xml/index.d.ts +108 -0
- package/xml/index.js +574 -0
- package/xml/index.js.map +1 -0
- package/css/package.json +0 -36
- package/css-value/package.json +0 -23
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import * as types from '../utils/types';
|
|
2
|
+
import * as knownColors from './known-colors';
|
|
3
|
+
import { HEX_REGEX, argbFromColorMix, argbFromHslOrHsla, argbFromHsvOrHsva, argbFromRgbOrRgba, hslToRgb, hsvToRgb, isCssColorMixExpression, isHslOrHsla, isHsvOrHsva, isRgbOrRgba, rgbToHsl, rgbToHsv, argbFromString } from './color-utils';
|
|
4
|
+
export class ColorBase {
|
|
5
|
+
constructor(...args) {
|
|
6
|
+
if (args.length === 1) {
|
|
7
|
+
const arg = args[0];
|
|
8
|
+
if (types.isString(arg)) {
|
|
9
|
+
const lowered = arg.toLowerCase();
|
|
10
|
+
if (isRgbOrRgba(lowered)) {
|
|
11
|
+
this._argb = argbFromRgbOrRgba(lowered);
|
|
12
|
+
}
|
|
13
|
+
else if (isHslOrHsla(lowered)) {
|
|
14
|
+
this._argb = argbFromHslOrHsla(lowered);
|
|
15
|
+
}
|
|
16
|
+
else if (isHsvOrHsva(lowered)) {
|
|
17
|
+
this._argb = argbFromHsvOrHsva(lowered);
|
|
18
|
+
}
|
|
19
|
+
else if (knownColors.isKnownName(lowered)) {
|
|
20
|
+
// The parameter is a known color name
|
|
21
|
+
const argb = knownColors.getKnownColor(lowered);
|
|
22
|
+
this._name = arg;
|
|
23
|
+
this._argb = argb;
|
|
24
|
+
}
|
|
25
|
+
else if (isCssColorMixExpression(lowered)) {
|
|
26
|
+
this._argb = argbFromColorMix(lowered);
|
|
27
|
+
}
|
|
28
|
+
else if (arg[0].charAt(0) === '#' && (arg.length === 4 || arg.length === 5 || arg.length === 7 || arg.length === 9)) {
|
|
29
|
+
// we dont use the regexp as it is quite slow. Instead we expect it to be a valid hex format
|
|
30
|
+
// strange that it would not be. And if it is not a thrown error seems best
|
|
31
|
+
// The parameter is a "#RRGGBBAA" formatted string
|
|
32
|
+
this._argb = this._argbFromString(arg);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
throw new Error('Invalid color: ' + arg);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
else if (types.isNumber(arg)) {
|
|
39
|
+
// The parameter is a 32-bit unsigned integer where each 8 bits specify a color component
|
|
40
|
+
// In case a 32-bit signed int (Android, Java has no unsigned types) was provided - convert to unsigned by applyint >>> 0
|
|
41
|
+
this._argb = arg >>> 0;
|
|
42
|
+
}
|
|
43
|
+
else if (arg && arg._argb) {
|
|
44
|
+
// we would go there if a color was passed as an argument (or an object which is why we dont do instanceof)
|
|
45
|
+
// The parameter is a 32-bit unsigned integer where each 8 bits specify a color component
|
|
46
|
+
// In case a 32-bit signed int (Android, Java has no unsigned types) was provided - convert to unsigned by applyint >>> 0
|
|
47
|
+
this._argb = arg._argb >>> 0;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
throw new Error('Expected 1 or 4 constructor parameters.');
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
else if (args.length >= 4) {
|
|
54
|
+
const a = args[0];
|
|
55
|
+
switch (args[4]) {
|
|
56
|
+
case 'hsl': {
|
|
57
|
+
const { r, g, b } = hslToRgb(args[1], args[2], args[3]);
|
|
58
|
+
this._argb = (a & 0xff) * 0x01000000 + (r & 0xff) * 0x00010000 + (g & 0xff) * 0x00000100 + (b & 0xff) * 0x00000001;
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
case 'hsv': {
|
|
62
|
+
const { r, g, b } = hsvToRgb(args[1], args[2], args[3]);
|
|
63
|
+
this._argb = (a & 0xff) * 0x01000000 + (r & 0xff) * 0x00010000 + (g & 0xff) * 0x00000100 + (b & 0xff) * 0x00000001;
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
default:
|
|
67
|
+
this._argb = (a & 0xff) * 0x01000000 + (args[1] & 0xff) * 0x00010000 + (args[2] & 0xff) * 0x00000100 + (args[3] & 0xff) * 0x00000001;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
throw new Error('Expected 1 or 4 constructor parameters.');
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
get a() {
|
|
76
|
+
return (this._argb / 0x01000000) & 0xff;
|
|
77
|
+
}
|
|
78
|
+
get r() {
|
|
79
|
+
return (this._argb / 0x00010000) & 0xff;
|
|
80
|
+
}
|
|
81
|
+
get g() {
|
|
82
|
+
return (this._argb / 0x00000100) & 0xff;
|
|
83
|
+
}
|
|
84
|
+
get b() {
|
|
85
|
+
return (this._argb / 0x00000001) & 0xff;
|
|
86
|
+
}
|
|
87
|
+
get argb() {
|
|
88
|
+
return this._argb;
|
|
89
|
+
}
|
|
90
|
+
get hex() {
|
|
91
|
+
let result = '#' + ('000000' + (this._argb & 0xffffff).toString(16)).toUpperCase().slice(-6);
|
|
92
|
+
if (this.a !== 0xff) {
|
|
93
|
+
return (result += ('00' + this.a.toString(16).toUpperCase()).slice(-2));
|
|
94
|
+
}
|
|
95
|
+
return result;
|
|
96
|
+
}
|
|
97
|
+
get name() {
|
|
98
|
+
return this._name;
|
|
99
|
+
}
|
|
100
|
+
get ios() {
|
|
101
|
+
return undefined;
|
|
102
|
+
}
|
|
103
|
+
get android() {
|
|
104
|
+
return undefined;
|
|
105
|
+
}
|
|
106
|
+
_argbFromString(hex) {
|
|
107
|
+
return argbFromString(hex);
|
|
108
|
+
}
|
|
109
|
+
equals(value) {
|
|
110
|
+
return value && this.argb === value.argb;
|
|
111
|
+
}
|
|
112
|
+
static equals(value1, value2) {
|
|
113
|
+
// both values are falsy
|
|
114
|
+
if (!value1 && !value2) {
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
// only one is falsy
|
|
118
|
+
if (!value1 || !value2) {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
return value1.equals(value2);
|
|
122
|
+
}
|
|
123
|
+
static isValid(value) {
|
|
124
|
+
if (value instanceof ColorBase) {
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
if (!types.isString(value)) {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
const lowered = value.toLowerCase();
|
|
131
|
+
if (knownColors.isKnownName(lowered)) {
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
return HEX_REGEX.test(value) || isRgbOrRgba(lowered) || isHslOrHsla(lowered);
|
|
135
|
+
}
|
|
136
|
+
static fromHSL(a, h, s, l) {
|
|
137
|
+
return new ColorBase(a, h, s, l, 'hsl');
|
|
138
|
+
}
|
|
139
|
+
static fromHSV(a, h, s, l) {
|
|
140
|
+
return new ColorBase(a, h, s, l, 'hsv');
|
|
141
|
+
}
|
|
142
|
+
toString() {
|
|
143
|
+
return this.hex;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* @param {UIColor} value
|
|
147
|
+
*/
|
|
148
|
+
static fromIosColor(value) {
|
|
149
|
+
return undefined;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* return true if brightness < 128
|
|
153
|
+
*
|
|
154
|
+
*/
|
|
155
|
+
isDark() {
|
|
156
|
+
return this.getBrightness() < 128;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* return true if brightness >= 128
|
|
160
|
+
*
|
|
161
|
+
*/
|
|
162
|
+
isLight() {
|
|
163
|
+
return !this.isDark();
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* return the [brightness](http://www.w3.org/TR/AERT#color-contrast)
|
|
167
|
+
*
|
|
168
|
+
*/
|
|
169
|
+
getBrightness() {
|
|
170
|
+
return (this.r * 299 + this.g * 587 + this.b * 114) / 1000;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* return the [luminance](http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef)
|
|
174
|
+
*
|
|
175
|
+
*/
|
|
176
|
+
getLuminance() {
|
|
177
|
+
let R, G, B;
|
|
178
|
+
const RsRGB = this.r / 255;
|
|
179
|
+
const GsRGB = this.g / 255;
|
|
180
|
+
const BsRGB = this.b / 255;
|
|
181
|
+
if (RsRGB <= 0.03928) {
|
|
182
|
+
R = RsRGB / 12.92;
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);
|
|
186
|
+
}
|
|
187
|
+
if (GsRGB <= 0.03928) {
|
|
188
|
+
G = GsRGB / 12.92;
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);
|
|
192
|
+
}
|
|
193
|
+
if (BsRGB <= 0.03928) {
|
|
194
|
+
B = BsRGB / 12.92;
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);
|
|
198
|
+
}
|
|
199
|
+
return 0.2126 * R + 0.7152 * G + 0.0722 * B;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Return this color (as a new Color instance) with the provided alpha
|
|
203
|
+
*
|
|
204
|
+
* @param alpha (between 0 and 255)
|
|
205
|
+
*/
|
|
206
|
+
setAlpha(a) {
|
|
207
|
+
return new ColorBase(a, this.r, this.g, this.b);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* return the hsl representation of the color
|
|
211
|
+
*
|
|
212
|
+
*/
|
|
213
|
+
toHsl() {
|
|
214
|
+
return { ...rgbToHsl(this.r, this.g, this.b), a: this.a };
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* return the [CSS hsl](https://www.w3schools.com/Css/css_colors_hsl.asp) representation of the color
|
|
218
|
+
*
|
|
219
|
+
*/
|
|
220
|
+
toHslString() {
|
|
221
|
+
const hsl = rgbToHsl(this.r, this.g, this.b);
|
|
222
|
+
const h = Math.round(hsl.h), s = Math.round(hsl.s), l = Math.round(hsl.l);
|
|
223
|
+
const a = this.a;
|
|
224
|
+
return a == 255 ? 'hsl(' + h + ', ' + s + '%, ' + l + '%)' : 'hsla(' + h + ', ' + s + '%, ' + l + '%, ' + (a / 255).toFixed(2) + ')';
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* return the hsv representation of the color
|
|
228
|
+
*
|
|
229
|
+
*/
|
|
230
|
+
toHsv() {
|
|
231
|
+
return { ...rgbToHsv(this.r, this.g, this.b), a: this.a };
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* return the [CSS hsv](https://www.w3schools.com/Css/css_colors_rgb.asp) representation of the color
|
|
235
|
+
*
|
|
236
|
+
*/
|
|
237
|
+
toHsvString() {
|
|
238
|
+
const hsv = rgbToHsv(this.r, this.g, this.b);
|
|
239
|
+
const h = Math.round(hsv.h * 360), s = Math.round(hsv.s * 100), v = Math.round(hsv.v * 100);
|
|
240
|
+
const a = this.a;
|
|
241
|
+
return a == 255 ? 'hsv(' + h + ', ' + s + '%, ' + v + '%)' : 'hsva(' + h + ', ' + s + '%, ' + v + '%, ' + (a / 255).toFixed(2) + ')';
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* return the [CSS rgb](https://www.w3schools.com/Css/css_colors_rgb.asp) representation of the color
|
|
245
|
+
*
|
|
246
|
+
*/
|
|
247
|
+
toRgbString() {
|
|
248
|
+
const a = this.a;
|
|
249
|
+
return a == 1 ? 'rgb(' + Math.round(this.r) + ', ' + Math.round(this.g) + ', ' + Math.round(this.b) + ')' : 'rgba(' + Math.round(this.r) + ', ' + Math.round(this.g) + ', ' + Math.round(this.b) + ', ' + (a / 255).toFixed(2) + ')';
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Desaturate the color a given amount, from 0 to 100. Providing 100 will is the same as calling greyscale.
|
|
253
|
+
*
|
|
254
|
+
* @param amount (between 0 and 100)
|
|
255
|
+
*/
|
|
256
|
+
desaturate(amount) {
|
|
257
|
+
amount = amount === 0 ? 0 : amount || 10;
|
|
258
|
+
const hsl = rgbToHsl(this.r, this.g, this.b);
|
|
259
|
+
return ColorBase.fromHSL(this.a, hsl.h, Math.min(100, Math.max(0, hsl.s - amount)), hsl.l);
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Saturate the color a given amount, from 0 to 100.
|
|
263
|
+
*
|
|
264
|
+
* @param amount (between 0 and 100)
|
|
265
|
+
*/
|
|
266
|
+
saturate(amount) {
|
|
267
|
+
amount = amount === 0 ? 0 : amount || 10;
|
|
268
|
+
const hsl = rgbToHsl(this.r, this.g, this.b);
|
|
269
|
+
return ColorBase.fromHSL(this.a, hsl.h, Math.min(100, Math.max(0, hsl.s + amount)), hsl.l);
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Completely desaturates a color into greyscale. Same as calling desaturate(100).
|
|
273
|
+
*
|
|
274
|
+
*/
|
|
275
|
+
greyscale() {
|
|
276
|
+
return this.desaturate(100);
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Lighten the color a given amount, from 0 to 100. Providing 100 will always return white.
|
|
280
|
+
*
|
|
281
|
+
* @param amount (between 0 and 100)
|
|
282
|
+
*/
|
|
283
|
+
lighten(amount) {
|
|
284
|
+
amount = amount === 0 ? 0 : amount || 10;
|
|
285
|
+
const hsl = rgbToHsl(this.r, this.g, this.b);
|
|
286
|
+
return ColorBase.fromHSL(this.a, hsl.h, hsl.s, Math.min(100, Math.max(0, hsl.l + amount)));
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Brighten the color a given amount, from 0 to 100.
|
|
290
|
+
*
|
|
291
|
+
* @param amount (between 0 and 100)
|
|
292
|
+
*/
|
|
293
|
+
brighten(amount) {
|
|
294
|
+
amount = amount === 0 ? 0 : amount || 10;
|
|
295
|
+
const r = Math.max(0, Math.min(255, this.r - Math.round(255 * -(amount / 100))));
|
|
296
|
+
const g = Math.max(0, Math.min(255, this.g - Math.round(255 * -(amount / 100))));
|
|
297
|
+
const b = Math.max(0, Math.min(255, this.b - Math.round(255 * -(amount / 100))));
|
|
298
|
+
return new ColorBase(this.a, r, g, b);
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Darken the color a given amount, from 0 to 100. Providing 100 will always return black.
|
|
302
|
+
*
|
|
303
|
+
* @param amount (between 0 and 100)
|
|
304
|
+
*/
|
|
305
|
+
darken(amount) {
|
|
306
|
+
amount = amount === 0 ? 0 : amount || 10;
|
|
307
|
+
const hsl = rgbToHsl(this.r, this.g, this.b);
|
|
308
|
+
return ColorBase.fromHSL(this.a, hsl.h, hsl.s, Math.min(100, Math.max(0, hsl.l - amount)));
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Spin the hue a given amount, from -360 to 360. Calling with 0, 360, or -360 will do nothing (since it sets the hue back to what it was before).
|
|
312
|
+
*
|
|
313
|
+
* @param amount (between -360 and 360)
|
|
314
|
+
*/
|
|
315
|
+
spin(amount) {
|
|
316
|
+
const hsl = this.toHsl();
|
|
317
|
+
const hue = (hsl.h + amount) % 360;
|
|
318
|
+
hsl.h = hue < 0 ? 360 + hue : hue;
|
|
319
|
+
return ColorBase.fromHSL(this.a, hsl.h, hsl.s, hsl.l);
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* returns the color complement
|
|
323
|
+
*
|
|
324
|
+
*/
|
|
325
|
+
complement() {
|
|
326
|
+
const hsl = this.toHsl();
|
|
327
|
+
hsl.h = (hsl.h + 180) % 360;
|
|
328
|
+
return ColorBase.fromHSL(this.a, hsl.h, hsl.s, hsl.l);
|
|
329
|
+
}
|
|
330
|
+
static mix(color1, color2, amount = 50) {
|
|
331
|
+
const p = amount / 100;
|
|
332
|
+
const rgba = {
|
|
333
|
+
r: (color2.r - color1.r) * p + color1.r,
|
|
334
|
+
g: (color2.g - color1.g) * p + color1.g,
|
|
335
|
+
b: (color2.b - color1.b) * p + color1.b,
|
|
336
|
+
a: (color2.a - color1.a) * p + color1.a,
|
|
337
|
+
};
|
|
338
|
+
return new ColorBase(rgba.a, rgba.r, rgba.g, rgba.b);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
//# sourceMappingURL=color-common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-common.js","sourceRoot":"","sources":["../../../../packages/core/color/color-common.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,QAAQ,EAAE,uBAAuB,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE7O,MAAM,OAAO,SAAS;IAOrB,YAAY,GAAG,IAAI;QAClB,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YACpB,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBACzB,MAAM,OAAO,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;gBAClC,IAAI,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;oBAC1B,IAAI,CAAC,KAAK,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;gBACzC,CAAC;qBAAM,IAAI,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;oBACjC,IAAI,CAAC,KAAK,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;gBACzC,CAAC;qBAAM,IAAI,WAAW,CAAC,OAAO,CA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G,CAAC,GAAG,MAAM,CAAC,CAAC;YACvC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC;YACvC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC;YACvC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC;SACvC,CAAC;QAEF,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACtD,CAAC;CACD"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export interface IColor {
|
|
2
|
+
readonly a: number;
|
|
3
|
+
readonly r: number;
|
|
4
|
+
readonly g: number;
|
|
5
|
+
readonly b: number;
|
|
6
|
+
readonly hex: string;
|
|
7
|
+
readonly argb: number;
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly android: number;
|
|
10
|
+
readonly ios: any;
|
|
11
|
+
equals(value: IColor): boolean;
|
|
12
|
+
isDark(): boolean;
|
|
13
|
+
isLight(): boolean;
|
|
14
|
+
getBrightness(): number;
|
|
15
|
+
getLuminance(): number;
|
|
16
|
+
setAlpha(a: number): IColor;
|
|
17
|
+
toHsl(): {
|
|
18
|
+
h: number;
|
|
19
|
+
s: number;
|
|
20
|
+
l: number;
|
|
21
|
+
a: number;
|
|
22
|
+
};
|
|
23
|
+
toHslString(): string;
|
|
24
|
+
toHsv(): {
|
|
25
|
+
h: number;
|
|
26
|
+
s: number;
|
|
27
|
+
v: number;
|
|
28
|
+
a: number;
|
|
29
|
+
};
|
|
30
|
+
toHsvString(): string;
|
|
31
|
+
toRgbString(): string;
|
|
32
|
+
desaturate(amount: number): IColor;
|
|
33
|
+
saturate(amount: number): IColor;
|
|
34
|
+
greyscale(): IColor;
|
|
35
|
+
lighten(amount: number): IColor;
|
|
36
|
+
brighten(amount: number): IColor;
|
|
37
|
+
darken(amount: number): IColor;
|
|
38
|
+
spin(amount: number): IColor;
|
|
39
|
+
complement(): IColor;
|
|
40
|
+
}
|
|
41
|
+
export type ColorClass = {
|
|
42
|
+
new (...args: any[]): IColor;
|
|
43
|
+
isValid(value: any): boolean;
|
|
44
|
+
fromIosColor(value: any): IColor;
|
|
45
|
+
fromHSL(a: number, h: number, s: number, l: number): IColor;
|
|
46
|
+
fromHSV(a: number, h: number, s: number, l: number): IColor;
|
|
47
|
+
mix(color1: IColor, color2: IColor, amount?: number): IColor;
|
|
48
|
+
equals(value1: IColor, value2: IColor): boolean;
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-types.js","sourceRoot":"","sources":["../../../../packages/core/color/color-types.ts"],"names":[],"mappings":"AAAA,4EAA4E"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export declare const HEX_REGEX: RegExp;
|
|
2
|
+
export declare function isCssColorMixExpression(value: string): boolean;
|
|
3
|
+
export declare function argbFromColorMix(value: string): number;
|
|
4
|
+
export declare function fromArgbToRgba(argb: number): {
|
|
5
|
+
a: number;
|
|
6
|
+
r: number;
|
|
7
|
+
g: number;
|
|
8
|
+
b: number;
|
|
9
|
+
};
|
|
10
|
+
export declare function isRgbOrRgba(value: string): boolean;
|
|
11
|
+
export declare function isHslOrHsla(value: string): boolean;
|
|
12
|
+
export declare function isHsvOrHsva(value: string): boolean;
|
|
13
|
+
export declare function parseColorWithAlpha(value: string): any;
|
|
14
|
+
export declare function argbFromString(hex: string): number;
|
|
15
|
+
export declare function argbFromRgbOrRgba(value: string): number;
|
|
16
|
+
export declare function argbFromHslOrHsla(value: string): number;
|
|
17
|
+
export declare function argbFromHsvOrHsva(value: string): number;
|
|
18
|
+
export declare function rgbToHsl(r: number, g: number, b: number): {
|
|
19
|
+
h: number;
|
|
20
|
+
s: number;
|
|
21
|
+
l: number;
|
|
22
|
+
};
|
|
23
|
+
export declare function hue2rgb(p: number, q: number, t: number): number;
|
|
24
|
+
export declare function hslToRgb(h1: number, s1: number, l1: number): {
|
|
25
|
+
r: number;
|
|
26
|
+
g: number;
|
|
27
|
+
b: number;
|
|
28
|
+
};
|
|
29
|
+
export declare function rgbToHsv(r: number, g: number, b: number): {
|
|
30
|
+
h: number;
|
|
31
|
+
s: number;
|
|
32
|
+
v: number;
|
|
33
|
+
};
|
|
34
|
+
export declare function hsvToRgb(h1: number, s1: number, v1: number): {
|
|
35
|
+
r: number;
|
|
36
|
+
g: number;
|
|
37
|
+
b: number;
|
|
38
|
+
};
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { color } from '@csstools/css-color-parser';
|
|
2
|
+
import { parseComponentValue } from '@csstools/css-parser-algorithms';
|
|
3
|
+
import { serializeRGB } from '@csstools/css-color-parser';
|
|
4
|
+
import { tokenize } from '@csstools/css-tokenizer';
|
|
5
|
+
export const HEX_REGEX = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)|(^#[0-9A-F]{8}$)|(^#[0-9A-F]{4}$)/i;
|
|
6
|
+
export function isCssColorMixExpression(value) {
|
|
7
|
+
return value.includes('color-mix(');
|
|
8
|
+
}
|
|
9
|
+
export function argbFromColorMix(value) {
|
|
10
|
+
const astComponentValue = parseComponentValue(tokenize({ css: value }));
|
|
11
|
+
const colorData = color(astComponentValue);
|
|
12
|
+
let argb;
|
|
13
|
+
if (colorData) {
|
|
14
|
+
const serialized = serializeRGB(colorData);
|
|
15
|
+
argb = argbFromRgbOrRgba(serialized.toString());
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
argb = -1;
|
|
19
|
+
}
|
|
20
|
+
return argb;
|
|
21
|
+
}
|
|
22
|
+
export function fromArgbToRgba(argb) {
|
|
23
|
+
return {
|
|
24
|
+
a: (argb >> 24) & 0xff,
|
|
25
|
+
r: (argb >> 16) & 0xff,
|
|
26
|
+
g: (argb >> 8) & 0xff,
|
|
27
|
+
b: argb & 0xff,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export function isRgbOrRgba(value) {
|
|
31
|
+
return (value.startsWith('rgb(') || value.startsWith('rgba(')) && value.endsWith(')');
|
|
32
|
+
}
|
|
33
|
+
export function isHslOrHsla(value) {
|
|
34
|
+
return (value.startsWith('hsl') || value.startsWith('hsla(')) && value.endsWith(')');
|
|
35
|
+
}
|
|
36
|
+
export function isHsvOrHsva(value) {
|
|
37
|
+
return (value.startsWith('hsv') || value.startsWith('hsva(')) && value.endsWith(')');
|
|
38
|
+
}
|
|
39
|
+
export function parseColorWithAlpha(value) {
|
|
40
|
+
const separator = value.indexOf(',') !== -1 ? ',' : ' ';
|
|
41
|
+
const parts = value
|
|
42
|
+
.replace(/(rgb|hsl|hsv)a?\(/, '')
|
|
43
|
+
.replace(')', '')
|
|
44
|
+
.replace(/\//, ' ')
|
|
45
|
+
.replace(/%/g, '')
|
|
46
|
+
.split(separator)
|
|
47
|
+
.filter((part) => Boolean(part.length));
|
|
48
|
+
let f = 255;
|
|
49
|
+
let s = 255;
|
|
50
|
+
let t = 255;
|
|
51
|
+
let a = 255;
|
|
52
|
+
if (parts[0]) {
|
|
53
|
+
f = parseFloat(parts[0].trim());
|
|
54
|
+
}
|
|
55
|
+
if (parts[1]) {
|
|
56
|
+
s = parseFloat(parts[1].trim());
|
|
57
|
+
}
|
|
58
|
+
if (parts[2]) {
|
|
59
|
+
t = parseFloat(parts[2].trim());
|
|
60
|
+
}
|
|
61
|
+
if (parts[3]) {
|
|
62
|
+
a = Math.round(parseFloat(parts[3].trim()) * 255);
|
|
63
|
+
}
|
|
64
|
+
return { f, s, t, a };
|
|
65
|
+
}
|
|
66
|
+
export function argbFromString(hex) {
|
|
67
|
+
// always called as SHARP as first char
|
|
68
|
+
hex = hex.substring(1);
|
|
69
|
+
const length = hex.length;
|
|
70
|
+
// first we normalize
|
|
71
|
+
if (length === 3) {
|
|
72
|
+
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
|
|
73
|
+
}
|
|
74
|
+
else if (length === 4) {
|
|
75
|
+
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2] + hex[3] + hex[3];
|
|
76
|
+
}
|
|
77
|
+
let intVal = parseInt(hex, 16);
|
|
78
|
+
if (hex.length === 6) {
|
|
79
|
+
// add the alpha component since the provided string is RRGGBB
|
|
80
|
+
intVal = (intVal & 0x00ffffff) + 0xff000000;
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
// the new format is #RRGGBBAA
|
|
84
|
+
// we need to shift the alpha value to 0x01000000 position
|
|
85
|
+
const a = (intVal / 0x00000001) & 0xff;
|
|
86
|
+
intVal = (intVal >>> 8) + (a & 0xff) * 0x01000000;
|
|
87
|
+
}
|
|
88
|
+
return intVal;
|
|
89
|
+
}
|
|
90
|
+
export function argbFromRgbOrRgba(value) {
|
|
91
|
+
const { f: r, s: g, t: b, a } = parseColorWithAlpha(value);
|
|
92
|
+
return (a & 0xff) * 0x01000000 + (r & 0xff) * 0x00010000 + (g & 0xff) * 0x00000100 + (b & 0xff);
|
|
93
|
+
}
|
|
94
|
+
export function argbFromHslOrHsla(value) {
|
|
95
|
+
const { f: h, s: s, t: l, a } = parseColorWithAlpha(value);
|
|
96
|
+
const { r, g, b } = hslToRgb(h, s, l);
|
|
97
|
+
return (a & 0xff) * 0x01000000 + (r & 0xff) * 0x00010000 + (g & 0xff) * 0x00000100 + (b & 0xff);
|
|
98
|
+
}
|
|
99
|
+
export function argbFromHsvOrHsva(value) {
|
|
100
|
+
const { f: h, s: s, t: v, a } = parseColorWithAlpha(value);
|
|
101
|
+
const { r, g, b } = hsvToRgb(h, s, v);
|
|
102
|
+
return (a & 0xff) * 0x01000000 + (r & 0xff) * 0x00010000 + (g & 0xff) * 0x00000100 + (b & 0xff);
|
|
103
|
+
}
|
|
104
|
+
// `rgbToHsl`
|
|
105
|
+
// Converts an RGB color value to HSL.
|
|
106
|
+
// *Assumes:* r, g, and b are contained in [0, 255]
|
|
107
|
+
// *Returns:* { h, s, l } in [0,360] and [0,100]
|
|
108
|
+
export function rgbToHsl(r, g, b) {
|
|
109
|
+
r /= 255;
|
|
110
|
+
g /= 255;
|
|
111
|
+
b /= 255;
|
|
112
|
+
const max = Math.max(r, g, b), min = Math.min(r, g, b);
|
|
113
|
+
let h, s;
|
|
114
|
+
const l = (max + min) / 2;
|
|
115
|
+
if (max == min) {
|
|
116
|
+
h = s = 0; // achromatic
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
const d = max - min;
|
|
120
|
+
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
121
|
+
switch (max) {
|
|
122
|
+
case r:
|
|
123
|
+
h = (g - b) / d + (g < b ? 6 : 0);
|
|
124
|
+
break;
|
|
125
|
+
case g:
|
|
126
|
+
h = (b - r) / d + 2;
|
|
127
|
+
break;
|
|
128
|
+
case b:
|
|
129
|
+
h = (r - g) / d + 4;
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
h /= 6;
|
|
133
|
+
}
|
|
134
|
+
return { h: h * 360, s: s * 100, l: l * 100 };
|
|
135
|
+
}
|
|
136
|
+
export function hue2rgb(p, q, t) {
|
|
137
|
+
if (t < 0)
|
|
138
|
+
t += 1;
|
|
139
|
+
if (t > 1)
|
|
140
|
+
t -= 1;
|
|
141
|
+
if (t < 1 / 6)
|
|
142
|
+
return p + (q - p) * 6 * t;
|
|
143
|
+
if (t < 1 / 2)
|
|
144
|
+
return q;
|
|
145
|
+
if (t < 2 / 3)
|
|
146
|
+
return p + (q - p) * (2 / 3 - t) * 6;
|
|
147
|
+
return p;
|
|
148
|
+
}
|
|
149
|
+
// `hslToRgb`
|
|
150
|
+
// Converts an HSL color value to RGB.
|
|
151
|
+
// *Assumes:* h is contained in [0, 360] and s and l are contained [0, 100]
|
|
152
|
+
// *Returns:* { r, g, b } in the set [0, 255]
|
|
153
|
+
export function hslToRgb(h1, s1, l1) {
|
|
154
|
+
const h = (h1 % 360) / 360;
|
|
155
|
+
const s = s1 / 100;
|
|
156
|
+
const l = l1 / 100;
|
|
157
|
+
let r, g, b;
|
|
158
|
+
if (s === 0) {
|
|
159
|
+
r = g = b = l; // achromatic
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
163
|
+
const p = 2 * l - q;
|
|
164
|
+
r = hue2rgb(p, q, h + 1 / 3);
|
|
165
|
+
g = hue2rgb(p, q, h);
|
|
166
|
+
b = hue2rgb(p, q, h - 1 / 3);
|
|
167
|
+
}
|
|
168
|
+
return { r: Math.round(r * 255), g: Math.round(g * 255), b: Math.round(b * 255) };
|
|
169
|
+
}
|
|
170
|
+
// `rgbToHsv`
|
|
171
|
+
// Converts an RGB color value to HSV
|
|
172
|
+
// *Assumes:* r, g, and b are contained in the set [0, 255]
|
|
173
|
+
// *Returns:* { h, s, v } in [0,360] and [0,100]
|
|
174
|
+
export function rgbToHsv(r, g, b) {
|
|
175
|
+
r /= 255;
|
|
176
|
+
g /= 255;
|
|
177
|
+
b /= 255;
|
|
178
|
+
const max = Math.max(r, g, b), min = Math.min(r, g, b);
|
|
179
|
+
let h;
|
|
180
|
+
const v = max;
|
|
181
|
+
const d = max - min;
|
|
182
|
+
const s = max === 0 ? 0 : d / max;
|
|
183
|
+
if (max == min) {
|
|
184
|
+
h = 0; // achromatic
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
switch (max) {
|
|
188
|
+
case r:
|
|
189
|
+
h = (g - b) / d + (g < b ? 6 : 0);
|
|
190
|
+
break;
|
|
191
|
+
case g:
|
|
192
|
+
h = (b - r) / d + 2;
|
|
193
|
+
break;
|
|
194
|
+
case b:
|
|
195
|
+
h = (r - g) / d + 4;
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
198
|
+
h /= 6;
|
|
199
|
+
}
|
|
200
|
+
return { h: h * 360, s: s * 100, v: v * 100 };
|
|
201
|
+
}
|
|
202
|
+
// `hsvToRgb`
|
|
203
|
+
// Converts an HSV color value to RGB.
|
|
204
|
+
// *Assumes:* h is contained in [0, 360] and s and v are contained [0, 100]
|
|
205
|
+
// *Returns:* { r, g, b } in the set [0, 255]
|
|
206
|
+
export function hsvToRgb(h1, s1, v1) {
|
|
207
|
+
const h = ((h1 % 360) / 360) * 6;
|
|
208
|
+
const s = s1 / 100;
|
|
209
|
+
const v = v1 / 100;
|
|
210
|
+
const i = Math.floor(h), f = h - i, p = v * (1 - s), q = v * (1 - f * s), t = v * (1 - (1 - f) * s), mod = i % 6, r = [v, q, p, p, t, v][mod], g = [t, v, v, q, p, p][mod], b = [p, p, t, v, v, q][mod];
|
|
211
|
+
return { r: r * 255, g: g * 255, b: b * 255 };
|
|
212
|
+
}
|
|
213
|
+
//# sourceMappingURL=color-utils.js.map
|