yuyeon 0.1.0-rc.13 → 0.1.0-rc.16
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/dist/abstract/items.d.ts +49 -0
- package/dist/components/alert/YAlert.d.ts +24 -0
- package/dist/components/alert/index.d.ts +1 -0
- package/dist/components/app/YApp.d.ts +8 -0
- package/dist/components/app/index.d.ts +1 -0
- package/dist/components/badge/YBadge.d.ts +142 -0
- package/dist/components/badge/index.d.ts +1 -0
- package/dist/components/bench/YBench.d.ts +4 -0
- package/dist/components/bench/index.d.ts +1 -0
- package/dist/components/button/YButton.d.ts +248 -0
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/card/YCard.d.ts +12 -0
- package/dist/components/card/YCardBody.d.ts +2 -0
- package/dist/components/card/YCardFooter.d.ts +2 -0
- package/dist/components/card/YCardHeader.d.ts +2 -0
- package/dist/components/card/index.d.ts +4 -0
- package/dist/components/checkbox/YCheckbox.d.ts +48 -0
- package/dist/components/checkbox/YInputCheckbox.d.ts +55 -0
- package/dist/components/checkbox/index.d.ts +3 -0
- package/dist/components/chip/YChip.d.ts +36 -0
- package/dist/components/chip/index.d.ts +1 -0
- package/dist/components/date-picker/YDateCalendar.d.ts +143 -0
- package/dist/components/date-picker/YDatePicker.d.ts +123 -0
- package/dist/components/date-picker/YDatePickerControl.d.ts +129 -0
- package/dist/components/date-picker/YMonthPicker.d.ts +29 -0
- package/dist/components/date-picker/YYearPicker.d.ts +44 -0
- package/dist/components/date-picker/index.d.ts +3 -0
- package/dist/components/default-provider/YDefaultProvider.d.ts +0 -0
- package/dist/components/default-provider/index.d.ts +0 -0
- package/dist/components/dialog/YDialog.d.ts +2333 -0
- package/dist/components/dialog/index.d.ts +1 -0
- package/dist/components/divider/YDivider.d.ts +16 -0
- package/dist/components/divider/index.d.ts +1 -0
- package/dist/components/dropdown/YDropdown.d.ts +651 -0
- package/dist/components/dropdown/index.d.ts +1 -0
- package/dist/components/field-input/YFieldInput.d.ts +416 -0
- package/dist/components/field-input/index.d.ts +1 -0
- package/dist/components/form/YForm.d.ts +42 -0
- package/dist/components/form/index.d.ts +1 -0
- package/dist/components/hover/YHover.d.ts +75 -0
- package/dist/components/icon/YIcon.d.ts +82 -0
- package/dist/components/icon/index.d.ts +1 -0
- package/dist/components/icons/YIconCheckbox.d.ts +14 -0
- package/dist/components/icons/YIconClear.d.ts +1 -0
- package/dist/components/icons/YIconDropdown.d.ts +1 -0
- package/dist/components/icons/YIconExpand.d.ts +1 -0
- package/dist/components/icons/YIconPageControl.d.ts +21 -0
- package/dist/components/icons/YIconSort.d.ts +19 -0
- package/dist/components/icons/index.d.ts +89 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/components/input/YInput.d.ts +336 -0
- package/dist/components/input/index.d.ts +1 -0
- package/dist/components/layer/YLayer.d.ts +2089 -0
- package/dist/components/layer/active-delay.d.ts +4 -0
- package/dist/components/layer/active-stack.d.ts +16 -0
- package/dist/components/layer/base.d.ts +22 -0
- package/dist/components/layer/content.d.ts +21 -0
- package/dist/components/layer/index.d.ts +1 -0
- package/dist/components/layer/scroll-strategies.d.ts +41 -0
- package/dist/components/list/YList.d.ts +24 -0
- package/dist/components/list/YListItem.d.ts +55 -0
- package/dist/components/list/index.d.ts +2 -0
- package/dist/components/loading/YSpinnerRing.d.ts +3 -0
- package/dist/components/loading/index.d.ts +1 -0
- package/dist/components/menu/YMenu.d.ts +2188 -0
- package/dist/components/menu/index.d.ts +1 -0
- package/dist/components/navigation/YNavigation.d.ts +1 -0
- package/dist/components/navigation/index.d.ts +1 -0
- package/dist/components/pagination/YPagination.d.ts +177 -0
- package/dist/components/pagination/index.d.ts +1 -0
- package/dist/components/panel/YDividePanel.d.ts +5 -0
- package/dist/components/panel/index.d.ts +1 -0
- package/dist/components/plate/YPlate.d.ts +11 -0
- package/dist/components/plate/index.d.ts +1 -0
- package/dist/components/progress-bar/YProgressBar.d.ts +78 -0
- package/dist/components/progress-bar/index.d.ts +1 -0
- package/dist/components/select/YSelect.d.ts +7241 -0
- package/dist/components/select/index.d.ts +1 -0
- package/dist/components/snackbar/YSnackbar.d.ts +90 -0
- package/dist/components/snackbar/index.d.ts +1 -0
- package/dist/components/switch/YSwitch.d.ts +108 -0
- package/dist/components/switch/index.d.ts +1 -0
- package/dist/components/tab/YTab.d.ts +284 -0
- package/dist/components/tab/YTabs.d.ts +131 -0
- package/dist/components/tab/index.d.ts +3 -0
- package/dist/components/tab/shared.d.ts +4 -0
- package/dist/components/tab/types.d.ts +5 -0
- package/dist/components/table/YDataTable.d.ts +453 -0
- package/dist/components/table/YDataTableBody.d.ts +110 -0
- package/dist/components/table/YDataTableCell.d.ts +57 -0
- package/dist/components/table/YDataTableControl.d.ts +71 -0
- package/dist/components/table/YDataTableHead.d.ts +72 -0
- package/dist/components/table/YDataTableLayer.d.ts +12 -0
- package/dist/components/table/YDataTableRow.d.ts +49 -0
- package/dist/components/table/YDataTableServer.d.ts +490 -0
- package/dist/components/table/YTable.d.ts +84 -0
- package/dist/components/table/composibles/header.d.ts +69 -0
- package/dist/components/table/composibles/items.d.ts +55 -0
- package/dist/components/table/composibles/options.d.ts +11 -0
- package/dist/components/table/composibles/pagination.d.ts +81 -0
- package/dist/components/table/composibles/selection.d.ts +82 -0
- package/dist/components/table/composibles/sorting.d.ts +44 -0
- package/dist/components/table/index.d.ts +3 -0
- package/dist/components/table/types/common.d.ts +2 -0
- package/dist/components/table/types/header.d.ts +23 -0
- package/dist/components/table/types/index.d.ts +57 -0
- package/dist/components/table/types/item.d.ts +21 -0
- package/dist/components/table/types/row.d.ts +4 -0
- package/dist/components/text-ellipsis/YTextEllipsis.d.ts +15 -0
- package/dist/components/text-ellipsis/index.d.ts +1 -0
- package/dist/components/text-highlighter/YTextHighlighter.d.ts +41 -0
- package/dist/components/text-highlighter/index.d.ts +1 -0
- package/dist/components/textarea/YTextarea.d.ts +589 -0
- package/dist/components/textarea/index.d.ts +1 -0
- package/dist/components/toggle-button/YToggleButton.d.ts +4 -0
- package/dist/components/toggle-button/index.d.ts +1 -0
- package/dist/components/tooltip/YTooltip.d.ts +3875 -0
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/transitions/expand-transition.d.ts +17 -0
- package/dist/components/transitions/index.d.ts +32 -0
- package/dist/components/tree-view/YTreeView.d.ts +154 -0
- package/dist/components/tree-view/YTreeViewNode.d.ts +202 -0
- package/dist/components/tree-view/index.d.ts +2 -0
- package/dist/components/tree-view/types.d.ts +15 -0
- package/dist/components/tree-view/util.d.ts +6 -0
- package/dist/composables/choice-link.d.ts +3 -0
- package/dist/composables/choice.d.ts +113 -0
- package/dist/composables/communication.d.ts +8 -0
- package/dist/composables/component.d.ts +3 -0
- package/dist/composables/coordinate/arrangement.d.ts +7 -0
- package/dist/composables/coordinate/index.d.ts +1672 -0
- package/dist/composables/coordinate/levitation.d.ts +7 -0
- package/dist/composables/coordinate/types.d.ts +7 -0
- package/dist/composables/coordinate/utils/point.d.ts +22 -0
- package/dist/composables/date/factory.d.ts +3 -0
- package/dist/composables/date/index.d.ts +12 -0
- package/dist/composables/date/setting.d.ts +5 -0
- package/dist/composables/date/types.d.ts +13 -0
- package/dist/composables/dimension.d.ts +54 -0
- package/dist/composables/focus.d.ts +30 -0
- package/dist/composables/form.d.ts +127 -0
- package/dist/composables/i18n/index.d.ts +9 -0
- package/dist/composables/i18n/locale.d.ts +3 -0
- package/dist/composables/i18n/rtl.d.ts +21 -0
- package/dist/composables/i18n/share.d.ts +1 -0
- package/dist/composables/icon.d.ts +95 -0
- package/dist/composables/index.d.ts +9 -0
- package/dist/composables/layer-group.d.ts +8 -0
- package/dist/composables/layout.d.ts +10 -0
- package/dist/composables/list-items.d.ts +111 -0
- package/dist/composables/progress.d.ts +3 -0
- package/dist/composables/ref.d.ts +6 -0
- package/dist/composables/resize-observer.d.ts +14 -0
- package/dist/composables/scope.d.ts +3 -0
- package/dist/composables/theme/factory.d.ts +4 -0
- package/dist/composables/theme/helper.d.ts +3 -0
- package/dist/composables/theme/index.d.ts +56 -0
- package/dist/composables/theme/setting.d.ts +10 -0
- package/dist/composables/theme/types.d.ts +28 -0
- package/dist/composables/timing.d.ts +20 -0
- package/dist/composables/transition.d.ts +22 -0
- package/dist/composables/validation.d.ts +82 -0
- package/dist/composables/vue-router.d.ts +43 -0
- package/dist/directives/complement-click/index.d.ts +26 -0
- package/dist/directives/plate-wave/index.d.ts +14 -0
- package/dist/directives/theme-class.d.ts +4 -0
- package/dist/etc/index.d.ts +1 -0
- package/dist/globals.d.ts +20 -0
- package/dist/i18n/built-in.d.ts +3 -0
- package/dist/i18n/config.d.ts +81 -0
- package/dist/i18n/types.d.ts +20 -0
- package/dist/index.d.ts +13 -0
- package/dist/locales/en.d.ts +6 -0
- package/dist/locales/index.d.ts +2 -0
- package/dist/locales/ko.d.ts +6 -0
- package/dist/mixins/di.d.ts +2 -0
- package/dist/mixins/rebind-attrs.d.ts +5 -0
- package/dist/shims.d.ts +51 -0
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +7 -0
- package/dist/util/anchor.d.ts +23 -0
- package/dist/util/array.d.ts +2 -0
- package/dist/util/collection.d.ts +1 -0
- package/dist/util/color/apca.d.ts +29 -0
- package/dist/util/color/const.d.ts +5 -0
- package/dist/util/color/contrast/contrast.d.ts +74 -0
- package/dist/util/color/conversion.d.ts +131 -0
- package/dist/util/color/hct/cam16.d.ts +116 -0
- package/dist/util/color/hct/hct-solver.d.ts +131 -0
- package/dist/util/color/hct/hct.d.ts +71 -0
- package/dist/util/color/hct/viewing-conditions.d.ts +58 -0
- package/dist/util/color/index.d.ts +4 -0
- package/dist/util/color/palettes/core-palette.d.ts +44 -0
- package/dist/util/color/palettes/tonal-palette.d.ts +40 -0
- package/dist/util/color/types.d.ts +14 -0
- package/dist/util/color/utils/math-utils.d.ts +82 -0
- package/dist/util/common.d.ts +13 -0
- package/dist/util/date/adapters/yuyeon-date-adapter.d.ts +43 -0
- package/dist/util/date/built-in.d.ts +41 -0
- package/dist/util/date/index.d.ts +3 -0
- package/dist/util/date/types.d.ts +167 -0
- package/dist/util/debounce.d.ts +11 -0
- package/dist/util/dom.d.ts +3 -0
- package/dist/util/frame-scheduler.d.ts +7 -0
- package/dist/util/index.d.ts +16 -0
- package/dist/util/reactivity.d.ts +7 -0
- package/dist/util/rect.d.ts +36 -0
- package/dist/util/scroll.d.ts +3 -0
- package/dist/util/string.d.ts +4 -0
- package/dist/util/ui.d.ts +4 -0
- package/dist/util/validation.d.ts +3 -0
- package/dist/util/vue-component.d.ts +39 -0
- package/dist/yuyeon.js +2974 -2971
- package/dist/yuyeon.umd.cjs +13 -13
- package/lib/components/badge/YBadge.scss +0 -1
- package/lib/components/field-input/YFieldInput.scss +1 -1
- package/lib/components/layer/YLayer.mjs +15 -7
- package/lib/components/layer/YLayer.mjs.map +1 -1
- package/lib/components/layer/content.mjs +22 -0
- package/lib/components/layer/content.mjs.map +1 -0
- package/lib/components/menu/YMenu.mjs +1 -9
- package/lib/components/menu/YMenu.mjs.map +1 -1
- package/lib/components/select/YSelect.mjs +8 -5
- package/lib/components/select/YSelect.mjs.map +1 -1
- package/lib/composables/coordinate/index.mjs.map +1 -1
- package/lib/composables/icon.mjs.map +1 -1
- package/lib/index.mjs +1 -1
- package/lib/index.mjs.map +1 -1
- package/package.json +11 -11
- package/types/components/dialog/YDialog.d.ts +2 -2
- package/types/components/dropdown/YDropdown.d.ts +6 -6
- package/types/components/layer/YLayer.d.ts +6 -6
- package/types/components/menu/YMenu.d.ts +5 -5
- package/types/components/select/YSelect.d.ts +41 -41
- package/types/components/tooltip/YTooltip.d.ts +11 -11
- package/types/composables/coordinate/index.d.ts +4 -4
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { Cam16 } from './cam16';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A class that solves the HCT equation.
|
|
5
|
+
*/
|
|
6
|
+
export declare class HctSolver {
|
|
7
|
+
static SCALED_DISCOUNT_FROM_LINRGB: number[][];
|
|
8
|
+
static LINRGB_FROM_SCALED_DISCOUNT: number[][];
|
|
9
|
+
static Y_FROM_LINRGB: number[];
|
|
10
|
+
static CRITICAL_PLANES: number[];
|
|
11
|
+
/**
|
|
12
|
+
* Sanitizes a small enough angle in radians.
|
|
13
|
+
*
|
|
14
|
+
* @param angle An angle in radians; must not deviate too much
|
|
15
|
+
* from 0.
|
|
16
|
+
* @return A coterminal angle between 0 and 2pi.
|
|
17
|
+
*/
|
|
18
|
+
private static sanitizeRadians;
|
|
19
|
+
/**
|
|
20
|
+
* Delinearizes an RGB component, returning a floating-point
|
|
21
|
+
* number.
|
|
22
|
+
*
|
|
23
|
+
* @param rgbComponent 0.0 <= rgb_component <= 100.0, represents
|
|
24
|
+
* linear R/G/B channel
|
|
25
|
+
* @return 0.0 <= output <= 255.0, color channel converted to
|
|
26
|
+
* regular RGB space
|
|
27
|
+
*/
|
|
28
|
+
private static trueDelinearized;
|
|
29
|
+
private static chromaticAdaptation;
|
|
30
|
+
/**
|
|
31
|
+
* Returns the hue of a linear RGB color in CAM16.
|
|
32
|
+
*
|
|
33
|
+
* @param linrgb The linear RGB coordinates of a color.
|
|
34
|
+
* @return The hue of the color in CAM16, in radians.
|
|
35
|
+
*/
|
|
36
|
+
private static hueOf;
|
|
37
|
+
private static areInCyclicOrder;
|
|
38
|
+
/**
|
|
39
|
+
* Solves the lerp equation.
|
|
40
|
+
*
|
|
41
|
+
* @param source The starting number.
|
|
42
|
+
* @param mid The number in the middle.
|
|
43
|
+
* @param target The ending number.
|
|
44
|
+
* @return A number t such that lerp(source, target, t) = mid.
|
|
45
|
+
*/
|
|
46
|
+
private static intercept;
|
|
47
|
+
private static lerpPoint;
|
|
48
|
+
/**
|
|
49
|
+
* Intersects a segment with a plane.
|
|
50
|
+
*
|
|
51
|
+
* @param source The coordinates of point A.
|
|
52
|
+
* @param coordinate The R-, G-, or B-coordinate of the plane.
|
|
53
|
+
* @param target The coordinates of point B.
|
|
54
|
+
* @param axis The axis the plane is perpendicular with. (0: R, 1:
|
|
55
|
+
* G, 2: B)
|
|
56
|
+
* @return The intersection point of the segment AB with the plane
|
|
57
|
+
* R=coordinate, G=coordinate, or B=coordinate
|
|
58
|
+
*/
|
|
59
|
+
private static setCoordinate;
|
|
60
|
+
private static isBounded;
|
|
61
|
+
/**
|
|
62
|
+
* Returns the nth possible vertex of the polygonal intersection.
|
|
63
|
+
*
|
|
64
|
+
* @param y The Y value of the plane.
|
|
65
|
+
* @param n The zero-based index of the point. 0 <= n <= 11.
|
|
66
|
+
* @return The nth possible vertex of the polygonal intersection
|
|
67
|
+
* of the y plane and the RGB cube, in linear RGB coordinates, if
|
|
68
|
+
* it exists. If this possible vertex lies outside of the cube,
|
|
69
|
+
* [-1.0, -1.0, -1.0] is returned.
|
|
70
|
+
*/
|
|
71
|
+
private static nthVertex;
|
|
72
|
+
/**
|
|
73
|
+
* Finds the segment containing the desired color.
|
|
74
|
+
*
|
|
75
|
+
* @param y The Y value of the color.
|
|
76
|
+
* @param targetHue The hue of the color.
|
|
77
|
+
* @return A list of two sets of linear RGB coordinates, each
|
|
78
|
+
* corresponding to an endpoint of the segment containing the
|
|
79
|
+
* desired color.
|
|
80
|
+
*/
|
|
81
|
+
private static bisectToSegment;
|
|
82
|
+
private static midpoint;
|
|
83
|
+
private static criticalPlaneBelow;
|
|
84
|
+
private static criticalPlaneAbove;
|
|
85
|
+
/**
|
|
86
|
+
* Finds a color with the given Y and hue on the boundary of the
|
|
87
|
+
* cube.
|
|
88
|
+
*
|
|
89
|
+
* @param y The Y value of the color.
|
|
90
|
+
* @param targetHue The hue of the color.
|
|
91
|
+
* @return The desired color, in linear RGB coordinates.
|
|
92
|
+
*/
|
|
93
|
+
private static bisectToLimit;
|
|
94
|
+
private static inverseChromaticAdaptation;
|
|
95
|
+
/**
|
|
96
|
+
* Finds a color with the given hue, chroma, and Y.
|
|
97
|
+
*
|
|
98
|
+
* @param hueRadians The desired hue in radians.
|
|
99
|
+
* @param chroma The desired chroma.
|
|
100
|
+
* @param y The desired Y.
|
|
101
|
+
* @return The desired color as a hexadecimal integer, if found; 0
|
|
102
|
+
* otherwise.
|
|
103
|
+
*/
|
|
104
|
+
private static findResultByJ;
|
|
105
|
+
/**
|
|
106
|
+
* Finds an sRGB color with the given hue, chroma, and L*, if
|
|
107
|
+
* possible.
|
|
108
|
+
*
|
|
109
|
+
* @param hueDegrees The desired hue, in degrees.
|
|
110
|
+
* @param chroma The desired chroma.
|
|
111
|
+
* @param lstar The desired L*.
|
|
112
|
+
* @return A hexadecimal representing the sRGB color. The color
|
|
113
|
+
* has sufficiently close hue, chroma, and L* to the desired
|
|
114
|
+
* values, if possible; otherwise, the hue and L* will be
|
|
115
|
+
* sufficiently close, and chroma will be maximized.
|
|
116
|
+
*/
|
|
117
|
+
static solveToInt(hueDegrees: number, chroma: number, lstar: number): number;
|
|
118
|
+
/**
|
|
119
|
+
* Finds an sRGB color with the given hue, chroma, and L*, if
|
|
120
|
+
* possible.
|
|
121
|
+
*
|
|
122
|
+
* @param hueDegrees The desired hue, in degrees.
|
|
123
|
+
* @param chroma The desired chroma.
|
|
124
|
+
* @param lstar The desired L*.
|
|
125
|
+
* @return An CAM16 object representing the sRGB color. The color
|
|
126
|
+
* has sufficiently close hue, chroma, and L* to the desired
|
|
127
|
+
* values, if possible; otherwise, the hue and L* will be
|
|
128
|
+
* sufficiently close, and chroma will be maximized.
|
|
129
|
+
*/
|
|
130
|
+
static solveToCam(hueDegrees: number, chroma: number, lstar: number): Cam16;
|
|
131
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ViewingConditions } from './viewing-conditions';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* HCT, hue, chroma, and tone. A color system that provides a perceptually
|
|
5
|
+
* accurate color measurement system that can also accurately render what colors
|
|
6
|
+
* will appear as in different lighting environments.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Hct {
|
|
9
|
+
private argb;
|
|
10
|
+
/**
|
|
11
|
+
* @param hue 0 <= hue < 360; invalid values are corrected.
|
|
12
|
+
* @param chroma 0 <= chroma < ?; Informally, colorfulness. The color
|
|
13
|
+
* returned may be lower than the requested chroma. Chroma has a different
|
|
14
|
+
* maximum for any given hue and tone.
|
|
15
|
+
* @param tone 0 <= tone <= 100; invalid values are corrected.
|
|
16
|
+
* @return HCT representation of a color in default viewing conditions.
|
|
17
|
+
*/
|
|
18
|
+
internalHue: number;
|
|
19
|
+
internalChroma: number;
|
|
20
|
+
internalTone: number;
|
|
21
|
+
static from(hue: number, chroma: number, tone: number): Hct;
|
|
22
|
+
/**
|
|
23
|
+
* @param argb ARGB representation of a color.
|
|
24
|
+
* @return HCT representation of a color in default viewing conditions
|
|
25
|
+
*/
|
|
26
|
+
static fromInt(argb: number): Hct;
|
|
27
|
+
toInt(): number;
|
|
28
|
+
/**
|
|
29
|
+
* A number, in degrees, representing ex. red, orange, yellow, etc.
|
|
30
|
+
* Ranges from 0 <= hue < 360.
|
|
31
|
+
*/
|
|
32
|
+
get hue(): number;
|
|
33
|
+
/**
|
|
34
|
+
* @param newHue 0 <= newHue < 360; invalid values are corrected.
|
|
35
|
+
* Chroma may decrease because chroma has a different maximum for any given
|
|
36
|
+
* hue and tone.
|
|
37
|
+
*/
|
|
38
|
+
set hue(newHue: number);
|
|
39
|
+
get chroma(): number;
|
|
40
|
+
/**
|
|
41
|
+
* @param newChroma 0 <= newChroma < ?
|
|
42
|
+
* Chroma may decrease because chroma has a different maximum for any given
|
|
43
|
+
* hue and tone.
|
|
44
|
+
*/
|
|
45
|
+
set chroma(newChroma: number);
|
|
46
|
+
/** Lightness. Ranges from 0 to 100. */
|
|
47
|
+
get tone(): number;
|
|
48
|
+
/**
|
|
49
|
+
* @param newTone 0 <= newTone <= 100; invalid valids are corrected.
|
|
50
|
+
* Chroma may decrease because chroma has a different maximum for any given
|
|
51
|
+
* hue and tone.
|
|
52
|
+
*/
|
|
53
|
+
set tone(newTone: number);
|
|
54
|
+
private constructor();
|
|
55
|
+
private setInternalState;
|
|
56
|
+
/**
|
|
57
|
+
* Translates a color into different [ViewingConditions].
|
|
58
|
+
*
|
|
59
|
+
* Colors change appearance. They look different with lights on versus off,
|
|
60
|
+
* the same color, as in hex code, on white looks different when on black.
|
|
61
|
+
* This is called color relativity, most famously explicated by Josef Albers
|
|
62
|
+
* in Interaction of Color.
|
|
63
|
+
*
|
|
64
|
+
* In color science, color appearance models can account for this and
|
|
65
|
+
* calculate the appearance of a color in different settings. HCT is based on
|
|
66
|
+
* CAM16, a color appearance model, and uses it to make these calculations.
|
|
67
|
+
*
|
|
68
|
+
* See [ViewingConditions.make] for parameters affecting color appearance.
|
|
69
|
+
*/
|
|
70
|
+
inViewingConditions(vc: ViewingConditions): Hct;
|
|
71
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In traditional color spaces, a color can be identified solely by the
|
|
3
|
+
* observer's measurement of the color. Color appearance models such as CAM16
|
|
4
|
+
* also use information about the environment where the color was
|
|
5
|
+
* observed, known as the viewing conditions.
|
|
6
|
+
*
|
|
7
|
+
* For example, white under the traditional assumption of a midday sun white
|
|
8
|
+
* point is accurately measured as a slightly chromatic blue by CAM16. (roughly,
|
|
9
|
+
* hue 203, chroma 3, lightness 100)
|
|
10
|
+
*
|
|
11
|
+
* This class caches intermediate values of the CAM16 conversion process that
|
|
12
|
+
* depend only on viewing conditions, enabling speed ups.
|
|
13
|
+
*/
|
|
14
|
+
export declare class ViewingConditions {
|
|
15
|
+
n: number;
|
|
16
|
+
aw: number;
|
|
17
|
+
nbb: number;
|
|
18
|
+
ncb: number;
|
|
19
|
+
c: number;
|
|
20
|
+
nc: number;
|
|
21
|
+
rgbD: number[];
|
|
22
|
+
fl: number;
|
|
23
|
+
fLRoot: number;
|
|
24
|
+
z: number;
|
|
25
|
+
/** sRGB-like viewing conditions. */
|
|
26
|
+
static DEFAULT: ViewingConditions;
|
|
27
|
+
/**
|
|
28
|
+
* Create ViewingConditions from a simple, physically relevant, set of
|
|
29
|
+
* parameters.
|
|
30
|
+
*
|
|
31
|
+
* @param whitePoint White point, measured in the XYZ color space.
|
|
32
|
+
* default = D65, or sunny day afternoon
|
|
33
|
+
* @param adaptingLuminance The luminance of the adapting field. Informally,
|
|
34
|
+
* how bright it is in the room where the color is viewed. Can be
|
|
35
|
+
* calculated from lux by multiplying lux by 0.0586. default = 11.72,
|
|
36
|
+
* or 200 lux.
|
|
37
|
+
* @param backgroundLstar The lightness of the area surrounding the color.
|
|
38
|
+
* measured by L* in L*a*b*. default = 50.0
|
|
39
|
+
* @param surround A general description of the lighting surrounding the
|
|
40
|
+
* color. 0 is pitch dark, like watching a movie in a theater. 1.0 is a
|
|
41
|
+
* dimly light room, like watching TV at home at night. 2.0 means there
|
|
42
|
+
* is no difference between the lighting on the color and around it.
|
|
43
|
+
* default = 2.0
|
|
44
|
+
* @param discountingIlluminant Whether the eye accounts for the tint of the
|
|
45
|
+
* ambient lighting, such as knowing an apple is still red in green light.
|
|
46
|
+
* default = false, the eye does not perform this process on
|
|
47
|
+
* self-luminous objects like displays.
|
|
48
|
+
*/
|
|
49
|
+
static make(whitePoint?: number[], adaptingLuminance?: number, backgroundLstar?: number, surround?: number, discountingIlluminant?: boolean): ViewingConditions;
|
|
50
|
+
/**
|
|
51
|
+
* Parameters are intermediate values of the CAM16 conversion process. Their
|
|
52
|
+
* names are shorthand for technical color science terminology, this class
|
|
53
|
+
* would not benefit from documenting them individually. A brief overview
|
|
54
|
+
* is available in the CAM16 specification, and a complete overview requires
|
|
55
|
+
* a color science textbook, such as Fairchild's Color Appearance Models.
|
|
56
|
+
*/
|
|
57
|
+
private constructor();
|
|
58
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { TonalPalette } from './tonal-palette';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Set of colors to generate a [CorePalette] from
|
|
5
|
+
*/
|
|
6
|
+
export interface CorePaletteColors {
|
|
7
|
+
primary: number;
|
|
8
|
+
secondary?: number;
|
|
9
|
+
tertiary?: number;
|
|
10
|
+
neutral?: number;
|
|
11
|
+
neutralVariant?: number;
|
|
12
|
+
error?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* An intermediate concept between the key color for a UI theme, and a full
|
|
16
|
+
* color scheme. 5 sets of tones are generated, all except one use the same hue
|
|
17
|
+
* as the key color, and all vary in chroma.
|
|
18
|
+
*/
|
|
19
|
+
export declare class CorePalette {
|
|
20
|
+
a1: TonalPalette;
|
|
21
|
+
a2: TonalPalette;
|
|
22
|
+
a3: TonalPalette;
|
|
23
|
+
n1: TonalPalette;
|
|
24
|
+
n2: TonalPalette;
|
|
25
|
+
error: TonalPalette;
|
|
26
|
+
/**
|
|
27
|
+
* @param argb ARGB representation of a color
|
|
28
|
+
*/
|
|
29
|
+
static of(argb: number): CorePalette;
|
|
30
|
+
/**
|
|
31
|
+
* @param argb ARGB representation of a color
|
|
32
|
+
*/
|
|
33
|
+
static contentOf(argb: number): CorePalette;
|
|
34
|
+
/**
|
|
35
|
+
* Create a [CorePalette] from a set of colors
|
|
36
|
+
*/
|
|
37
|
+
static fromColors(colors: CorePaletteColors): CorePalette;
|
|
38
|
+
/**
|
|
39
|
+
* Create a content [CorePalette] from a set of colors
|
|
40
|
+
*/
|
|
41
|
+
static contentFromColors(colors: CorePaletteColors): CorePalette;
|
|
42
|
+
private static createPaletteFromColors;
|
|
43
|
+
private constructor();
|
|
44
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Hct } from '../hct/hct';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A convenience class for retrieving colors that are constant in hue and
|
|
5
|
+
* chroma, but vary in tone.
|
|
6
|
+
*/
|
|
7
|
+
export declare class TonalPalette {
|
|
8
|
+
readonly hue: number;
|
|
9
|
+
readonly chroma: number;
|
|
10
|
+
readonly keyColor: Hct;
|
|
11
|
+
private readonly cache;
|
|
12
|
+
/**
|
|
13
|
+
* @param argb ARGB representation of a color
|
|
14
|
+
* @return Tones matching that color's hue and chroma.
|
|
15
|
+
*/
|
|
16
|
+
static fromInt(argb: number): TonalPalette;
|
|
17
|
+
/**
|
|
18
|
+
* @param hct Hct
|
|
19
|
+
* @return Tones matching that color's hue and chroma.
|
|
20
|
+
*/
|
|
21
|
+
static fromHct(hct: Hct): TonalPalette;
|
|
22
|
+
/**
|
|
23
|
+
* @param hue HCT hue
|
|
24
|
+
* @param chroma HCT chroma
|
|
25
|
+
* @return Tones matching hue and chroma.
|
|
26
|
+
*/
|
|
27
|
+
static fromHueAndChroma(hue: number, chroma: number): TonalPalette;
|
|
28
|
+
private constructor();
|
|
29
|
+
private static createKeyColor;
|
|
30
|
+
/**
|
|
31
|
+
* @param tone HCT tone, measured from 0 to 100.
|
|
32
|
+
* @return ARGB representation of a color with that tone.
|
|
33
|
+
*/
|
|
34
|
+
tone(tone: number): number;
|
|
35
|
+
/**
|
|
36
|
+
* @param tone HCT tone.
|
|
37
|
+
* @return HCT representation of a color with that tone.
|
|
38
|
+
*/
|
|
39
|
+
getHct(tone: number): Hct;
|
|
40
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RGBA component
|
|
3
|
+
*
|
|
4
|
+
* @param r Red value should be between 0-255
|
|
5
|
+
* @param g Green value should be between 0-255
|
|
6
|
+
* @param b Blue value should be between 0-255
|
|
7
|
+
* @param a Alpha value should be between 0-255
|
|
8
|
+
*/
|
|
9
|
+
export interface Rgba {
|
|
10
|
+
r: number;
|
|
11
|
+
g: number;
|
|
12
|
+
b: number;
|
|
13
|
+
a: number;
|
|
14
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Utility methods for mathematical operations.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* The signum function.
|
|
22
|
+
*
|
|
23
|
+
* @return 1 if num > 0, -1 if num < 0, and 0 if num = 0
|
|
24
|
+
*/
|
|
25
|
+
export declare function signum(num: number): number;
|
|
26
|
+
/**
|
|
27
|
+
* The linear interpolation function.
|
|
28
|
+
*
|
|
29
|
+
* @return start if amount = 0 and stop if amount = 1
|
|
30
|
+
*/
|
|
31
|
+
export declare function lerp(start: number, stop: number, amount: number): number;
|
|
32
|
+
/**
|
|
33
|
+
* Clamps an integer between two integers.
|
|
34
|
+
*
|
|
35
|
+
* @return input when min <= input <= max, and either min or max
|
|
36
|
+
* otherwise.
|
|
37
|
+
*/
|
|
38
|
+
export declare function clampInt(min: number, max: number, input: number): number;
|
|
39
|
+
/**
|
|
40
|
+
* Clamps an integer between two floating-point numbers.
|
|
41
|
+
*
|
|
42
|
+
* @return input when min <= input <= max, and either min or max
|
|
43
|
+
* otherwise.
|
|
44
|
+
*/
|
|
45
|
+
export declare function clampDouble(min: number, max: number, input: number): number;
|
|
46
|
+
/**
|
|
47
|
+
* Sanitizes a degree measure as an integer.
|
|
48
|
+
*
|
|
49
|
+
* @return a degree measure between 0 (inclusive) and 360
|
|
50
|
+
* (exclusive).
|
|
51
|
+
*/
|
|
52
|
+
export declare function sanitizeDegreesInt(degrees: number): number;
|
|
53
|
+
/**
|
|
54
|
+
* Sanitizes a degree measure as a floating-point number.
|
|
55
|
+
*
|
|
56
|
+
* @return a degree measure between 0.0 (inclusive) and 360.0
|
|
57
|
+
* (exclusive).
|
|
58
|
+
*/
|
|
59
|
+
export declare function sanitizeDegreesDouble(degrees: number): number;
|
|
60
|
+
/**
|
|
61
|
+
* Sign of direction change needed to travel from one angle to
|
|
62
|
+
* another.
|
|
63
|
+
*
|
|
64
|
+
* For angles that are 180 degrees apart from each other, both
|
|
65
|
+
* directions have the same travel distance, so either direction is
|
|
66
|
+
* shortest. The value 1.0 is returned in this case.
|
|
67
|
+
*
|
|
68
|
+
* @param from The angle travel starts from, in degrees.
|
|
69
|
+
* @param to The angle travel ends at, in degrees.
|
|
70
|
+
* @return -1 if decreasing from leads to the shortest travel
|
|
71
|
+
* distance, 1 if increasing from leads to the shortest travel
|
|
72
|
+
* distance.
|
|
73
|
+
*/
|
|
74
|
+
export declare function rotationDirection(from: number, to: number): number;
|
|
75
|
+
/**
|
|
76
|
+
* Distance of two points on a circle, represented using degrees.
|
|
77
|
+
*/
|
|
78
|
+
export declare function differenceDegrees(a: number, b: number): number;
|
|
79
|
+
/**
|
|
80
|
+
* Multiplies a 1x3 row vector with a 3x3 matrix.
|
|
81
|
+
*/
|
|
82
|
+
export declare function matrixMultiply(row: number[], matrix: number[][]): number[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function hasOwnProperty(object: any, property: string): boolean;
|
|
2
|
+
export declare function getNestedValue(obj: any, path: (string | number)[], fallback?: any): any;
|
|
3
|
+
export declare function mergeDeep(source?: Record<string, any>, overwrite?: Record<string, any>, arrayFn?: (source: unknown[], overwrite: unknown[]) => unknown[]): {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
};
|
|
6
|
+
export declare function getObjectValueByPath(obj: any, path: string, fallback?: any): any;
|
|
7
|
+
export type SelectItemKey = boolean | string | (string | number)[] | ((item: Record<string, any>, fallback?: any) => any);
|
|
8
|
+
export declare function getPropertyFromItem(item: any, property: SelectItemKey, fallback?: any): any;
|
|
9
|
+
export declare function clamp(value: number, min?: number, max?: number): number;
|
|
10
|
+
export declare function getRangeArr(length: number, start?: number): number[];
|
|
11
|
+
export declare function deepEqual(a: any, b: any): boolean;
|
|
12
|
+
export declare function isObject(obj: unknown): boolean;
|
|
13
|
+
export declare function omit<T extends object, U extends Extract<keyof T, string>>(obj: T, excludes: U[]): Omit<T, U>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { DateAdapter, DateFormatOptions } from '../types';
|
|
2
|
+
|
|
3
|
+
export declare class YuyeonDateAdapter implements DateAdapter<Date> {
|
|
4
|
+
locale: string;
|
|
5
|
+
formats?: Record<string, DateFormatOptions>;
|
|
6
|
+
constructor(options: {
|
|
7
|
+
locale: string;
|
|
8
|
+
formats?: Record<string, DateFormatOptions>;
|
|
9
|
+
});
|
|
10
|
+
getWeekArray(date: Date): Date[][];
|
|
11
|
+
startOfMonth(date: Date): Date;
|
|
12
|
+
endOfMonth(date: Date): Date;
|
|
13
|
+
addDays(date: Date, amount: number): Date;
|
|
14
|
+
addMonths(date: Date, amount: number): Date;
|
|
15
|
+
date(value?: any): Date | null;
|
|
16
|
+
endOfDay(date: Date): Date;
|
|
17
|
+
endOfYear(date: Date): Date;
|
|
18
|
+
format(date: Date, formatString: string): string;
|
|
19
|
+
getDiff(date: Date, comparing: string | Date, unit?: string): number;
|
|
20
|
+
getYear(date: Date): number;
|
|
21
|
+
getMonth(date: Date): number;
|
|
22
|
+
getDay(date: Date): number;
|
|
23
|
+
getNextMonth(date: Date): Date;
|
|
24
|
+
getWeekdays(): string[];
|
|
25
|
+
isAfter(date: Date, comparing: Date): boolean;
|
|
26
|
+
isBefore(date: Date, comparing: Date): boolean;
|
|
27
|
+
isEqual(date: Date, comparing: Date): boolean;
|
|
28
|
+
isSameDay(date: Date, comparing: Date): boolean;
|
|
29
|
+
isSameMonth(date: Date, comparing: Date): boolean;
|
|
30
|
+
isValid(date: any): boolean;
|
|
31
|
+
isWithinRange(date: Date, range: [Date, Date]): boolean;
|
|
32
|
+
parseISO(date: string): Date;
|
|
33
|
+
setMonth(date: Date, month: number): Date;
|
|
34
|
+
setYear(date: Date, year: number): Date;
|
|
35
|
+
startOfDay(date: Date): Date;
|
|
36
|
+
startOfYear(date: Date): Date;
|
|
37
|
+
toISO(date: Date): string;
|
|
38
|
+
toJsDate(date: Date): Date;
|
|
39
|
+
getHour(date: Date): number;
|
|
40
|
+
getMinute(date: Date): number;
|
|
41
|
+
setHour(date: Date, hour: number): Date;
|
|
42
|
+
setMinute(date: Date, minute: number): Date;
|
|
43
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { DateAdapter, DateFormatOptions } from './types';
|
|
2
|
+
|
|
3
|
+
export declare const ONE_DAY: number;
|
|
4
|
+
export declare const YYYY_MM_DD_REGEX: RegExp;
|
|
5
|
+
export declare const FIRST_SUNDAY: Date;
|
|
6
|
+
export declare class DateUtil {
|
|
7
|
+
static date(value?: any): Date | null;
|
|
8
|
+
static format(value: Date, formatString: string, locale: string, formats?: Record<string, DateFormatOptions>): string;
|
|
9
|
+
static parseLocalDate(value: string): Date;
|
|
10
|
+
static parseISO(value: string): Date;
|
|
11
|
+
static toISO(adapter: DateAdapter<any>, value: Date): string;
|
|
12
|
+
static getWeekArray(date: Date, locale: string): Date[][];
|
|
13
|
+
static startOfMonth(date: Date): Date;
|
|
14
|
+
static endOfMonth(date: Date): Date;
|
|
15
|
+
static startOfDay(date: Date): Date;
|
|
16
|
+
static startOfYear(date: Date): Date;
|
|
17
|
+
static endOfDay(date: Date): Date;
|
|
18
|
+
static endOfYear(date: Date): Date;
|
|
19
|
+
static getYear(date: Date): number;
|
|
20
|
+
static getMonth(date: Date): number;
|
|
21
|
+
static getDay(date: Date): number;
|
|
22
|
+
static getNextMonth(date: Date): Date;
|
|
23
|
+
static getWeekdays(locale: string): string[];
|
|
24
|
+
static getMeridians(locale: string): string[];
|
|
25
|
+
static isAfter(date: Date, comparing: Date): boolean;
|
|
26
|
+
static isBefore(date: Date, comparing: Date): boolean;
|
|
27
|
+
static isEqual(date: Date, comparing: Date): boolean;
|
|
28
|
+
static isSameDay(date: Date, comparing: Date): boolean;
|
|
29
|
+
static isSameMonth(date: Date, comparing: Date): boolean;
|
|
30
|
+
static isValid(date: any): boolean;
|
|
31
|
+
static isWithinRange(date: Date, range: [Date, Date]): boolean;
|
|
32
|
+
static addDays(date: Date, amount: number): Date;
|
|
33
|
+
static addMonths(date: Date, amount: number): Date;
|
|
34
|
+
static getDiff(date: Date, comparing: string | Date, unit?: 'month' | string): number;
|
|
35
|
+
static setMonth(date: Date, month: number): Date;
|
|
36
|
+
static setYear(date: Date, year: number): Date;
|
|
37
|
+
static getHour(date: Date): number;
|
|
38
|
+
static setHour(date: Date, hour: number): Date;
|
|
39
|
+
static getMinute(date: Date): number;
|
|
40
|
+
static setMinute(date: Date, minute: number): Date;
|
|
41
|
+
}
|