@rific/auto-paper 0.13.3 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -2
- package/dist/index.d.mts +42 -4
- package/dist/index.d.ts +42 -4
- package/dist/index.js +188 -58
- package/dist/index.mjs +157 -34
- package/package.json +2 -2
- package/src/ThemeProvider.tsx +25 -9
- package/src/components/AutoPalettePicker.tsx +11 -2
- package/src/components/PalettePicker.tsx +23 -9
- package/src/index.ts +6 -1
- package/src/useComputedTheme.ts +11 -3
- package/src/utils/getChalkboardColor.ts +77 -0
- package/src/utils/getColorRoles.ts +13 -2
- package/src/utils/getContrastRatio.ts +20 -0
- package/src/utils/getOklch.ts +68 -0
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Adaptive theming for [`react-native-paper`](https://callstack.github.io/react-native-paper/). Give it one color and an appearance setting, and it generates an MD3 palette and handles light/dark/system mode automatically.
|
|
4
4
|
|
|
5
|
+
**[Live demo](https://rific.jaydeaton.com/demos/auto-paper)**
|
|
6
|
+
|
|
5
7
|
## Features
|
|
6
8
|
|
|
7
9
|
- Color harmony palette from a single seed color (primary → secondary → tertiary), with 6 harmony modes available, defaulting to `split-complementary`
|
|
@@ -271,6 +273,7 @@ export default function App() {
|
|
|
271
273
|
| `navigationBar` | `ExpoNavigationBarModule` | Injects `expo-navigation-bar` (`import * as ExpoNavigationBar from 'expo-navigation-bar'`) so the Android nav bar icon style auto-syncs with the theme while a `BottomNavigation` is mounted. Omit (and don't pass `onNavBarChange`) to skip nav bar syncing entirely. |
|
|
272
274
|
| `onNavBarChange` | `(color: string, dark: boolean) => void` | Overrides the built-in nav bar sync: called on Android when the theme changes while a `BottomNavigation` is mounted, instead of the automatic `navigationBar`-driven icon-style sync |
|
|
273
275
|
| `onReady` | `() => void` | Called once when the theme first resolves |
|
|
276
|
+
| `paletteTone` | `PaletteTone` | Maps each palette color (primary, secondary and tertiary, after the harmony rotation) to the color the theme uses, given the resolved appearance: `(color, dark) => string`. Everything else (roles, containers, outline, surfaces) derives from the toned palette, the stored seed stays the player's raw pick, and `AutoPalettePicker` previews its swatches through the same tone. Signal colors (success, warning, danger, error) are never toned. Must be referentially stable (a module-level function). `getChalkboardColor` is one (marker in light mode, chalk in dark). Omit for the untoned palette. |
|
|
274
277
|
| `reanimated` | `ReanimatedModule` | Injects `react-native-reanimated` (for example `import Reanimated from 'react-native-reanimated'`) so `<Dialog animatedStyle={...}>` can animate its card on the UI thread. Omit to keep `animatedStyle` as a no-op. |
|
|
275
278
|
| `statusBar` | `boolean` | Renders React Native's `StatusBar`, styled from the theme (here and in `Appbar.Header`). Default `true`. Pass `false` when the app sets the status bar per screen instead (react-native-screens' `statusBarStyle`/`statusBarHidden` screen options, which need `UIViewControllerBasedStatusBarAppearance` on): there a React Native `StatusBar` logs an error. An app linked against the iOS 27 SDK can't set the status bar app-wide at all, which is the only way that component works on iOS, so per-screen options are the way to style it there. |
|
|
276
279
|
| `statusBarProps` | `StatusBarProps` | Spread over the auto-derived `StatusBar` defaults (ignored when `statusBar` is `false`) |
|
|
@@ -648,7 +651,7 @@ const appearance = useSelector((state: RootState) => selectThemeAppearance(state
|
|
|
648
651
|
### Color utilities
|
|
649
652
|
|
|
650
653
|
```ts
|
|
651
|
-
import { getTriadicPalette, getThirdColor, getBlendedColor, getColorRoles, getContrastColor, isDarkColor, getRgb, getHex, getTonalColor, getTintTextColor, resolveSeedColor } from '@rific/auto-paper'
|
|
654
|
+
import { getTriadicPalette, getThirdColor, getBlendedColor, getColorRoles, getContrastColor, getContrastRatio, getLuminance, isDarkColor, getRgb, getHex, getOklch, getOklchHex, getChalkboardColor, createChalkboardTone, getTonalColor, getTintTextColor, resolveSeedColor } from '@rific/auto-paper'
|
|
652
655
|
import type { ColorHarmony, TriadicPalette } from '@rific/auto-paper'
|
|
653
656
|
|
|
654
657
|
getTriadicPalette('#6750a4') // split-complementary (default)
|
|
@@ -661,11 +664,20 @@ getTriadicPalette('#6750a4', 'double-split')
|
|
|
661
664
|
getThirdColor('#e53935', '#1e88e5') // → '#59e52a' (hue maximally distant from both inputs; s/l averaged from both)
|
|
662
665
|
|
|
663
666
|
getBlendedColor('#ff0000', '#0000ff', 0.5) // → '#800080'
|
|
664
|
-
getColorRoles('#6750a4', '#fffbfe') // → { color, onColor, container, onContainer }: the MD3 color/onColor/container/onContainer math, generalized (this is what useComputedTheme uses internally for every role)
|
|
667
|
+
getColorRoles('#6750a4', '#fffbfe') // → { color, onColor, container, onContainer }: the MD3 color/onColor/container/onContainer math, generalized (this is what useComputedTheme uses internally for every role). onColor is light while light text reads on the color at 2.5:1, dark below that
|
|
668
|
+
getContrastRatio('#767676', '#ffffff') // → 4.54 (WCAG 2 contrast ratio, 1 to 21, either order)
|
|
669
|
+
getLuminance('#ffffff') // → 1 (WCAG 2 relative luminance, 0 for black)
|
|
665
670
|
getContrastColor('#6750a4') // → '#ffffff' (black/white pick for content sitting on a fully saturated fill)
|
|
666
671
|
isDarkColor('#6750a4') // → true
|
|
667
672
|
getRgb('coral') // → { r: 255, g: 127, b: 80 }
|
|
668
673
|
getHex('rgb(255, 0, 0)') // → '#ff0000'
|
|
674
|
+
getOklch('#6750a4') // → { l, c, h } (OKLCH: perceptual lightness 0-1, chroma, hue in degrees); null if unparseable
|
|
675
|
+
getOklchHex({ l: 0.5, c: 0.15, h: 300 }) // → back to hex, losing only as much chroma as it must to stay in sRGB
|
|
676
|
+
|
|
677
|
+
// Palette tones, for Provider's `paletteTone`: hue never moves, only lightness and chroma
|
|
678
|
+
getChalkboardColor('#e53935', false) // → a deeper marker red (light mode)
|
|
679
|
+
getChalkboardColor('#e53935', true) // → a pastel chalk red (dark mode)
|
|
680
|
+
const softChalk = createChalkboardTone({ chalk: { minLuminance: 0 } }) // your own tone (marker and chalk options); define it at module level so it stays referentially stable
|
|
669
681
|
|
|
670
682
|
resolveSeedColor('#6750a4') // → '#6750a4' (already a plain string)
|
|
671
683
|
resolveSeedColor({ primary: '#6750a4', secondary: '#a4916c', tertiary: '#916ca4' }) // → '#6750a4' (a ThemeSettings.color explicit triad narrows to its own primary)
|
package/dist/index.d.mts
CHANGED
|
@@ -22,6 +22,22 @@ declare const Appbar: {
|
|
|
22
22
|
BackAction: react_native_paper_lib_typescript_utils_forwardRef.ForwardRefComponent<react_native.View, react_native_paper.AppbarBackActionProps>;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
+
type PaletteTone = (color: string, dark: boolean) => string;
|
|
26
|
+
type ChalkboardToneOptions = {
|
|
27
|
+
marker?: {
|
|
28
|
+
maxLightness?: number;
|
|
29
|
+
chroma?: number;
|
|
30
|
+
};
|
|
31
|
+
chalk?: {
|
|
32
|
+
lightness?: number;
|
|
33
|
+
lift?: number;
|
|
34
|
+
chroma?: number;
|
|
35
|
+
minLuminance?: number;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
declare const createChalkboardTone: (options?: ChalkboardToneOptions) => PaletteTone;
|
|
39
|
+
declare const getChalkboardColor: PaletteTone;
|
|
40
|
+
|
|
25
41
|
type ColorHarmony = 'triadic' | 'split-complementary' | 'analogous' | 'square' | 'complementary' | 'double-split';
|
|
26
42
|
type TriadicPalette = {
|
|
27
43
|
primary: string;
|
|
@@ -53,7 +69,7 @@ type SemanticColorRoles = {
|
|
|
53
69
|
type AutoPaperTheme = Omit<MD3Theme, 'colors'> & {
|
|
54
70
|
colors: MD3Theme['colors'] & SemanticColorRoles;
|
|
55
71
|
};
|
|
56
|
-
declare function useComputedTheme(appearance: ThemeAppearance, color: string | TriadicPalette, harmony?: ColorHarmony): AutoPaperTheme | null;
|
|
72
|
+
declare function useComputedTheme(appearance: ThemeAppearance, color: string | TriadicPalette, harmony?: ColorHarmony, paletteTone?: PaletteTone): AutoPaperTheme | null;
|
|
57
73
|
|
|
58
74
|
type AppearanceIcons = Partial<Record<ThemeAppearance, string>>;
|
|
59
75
|
type Props$5 = {
|
|
@@ -96,8 +112,9 @@ type Props$2 = {
|
|
|
96
112
|
weights?: PaletteWeights;
|
|
97
113
|
colors?: SeedColor[];
|
|
98
114
|
blur?: boolean;
|
|
115
|
+
previewColor?: (color: string) => string;
|
|
99
116
|
};
|
|
100
|
-
declare const PalettePicker: ({ value, onChange, harmony, onHarmonyChange, weights, colors, blur: blurProp }: Props$2) => react.JSX.Element;
|
|
117
|
+
declare const PalettePicker: ({ value, onChange, harmony, onHarmonyChange, weights, colors, blur: blurProp, previewColor }: Props$2) => react.JSX.Element;
|
|
101
118
|
|
|
102
119
|
type Props$1 = {
|
|
103
120
|
weights?: PaletteWeights;
|
|
@@ -305,6 +322,7 @@ declare const useNavBarContext: () => NavBarContextType;
|
|
|
305
322
|
declare const useBlurModule: () => ExpoBlurModule | undefined;
|
|
306
323
|
declare const useReanimatedModule: () => ReanimatedModule | undefined;
|
|
307
324
|
declare const useMaskedViewModule: () => MaskedViewModule | undefined;
|
|
325
|
+
declare const usePaletteTone: () => PaletteTone | undefined;
|
|
308
326
|
type ProviderProps = {
|
|
309
327
|
children: ReactNode;
|
|
310
328
|
defaults?: PaperDefaults;
|
|
@@ -324,6 +342,15 @@ type ProviderProps = {
|
|
|
324
342
|
onChange?: (settings: ThemeSettings) => void;
|
|
325
343
|
onNavBarChange?: (color: string, dark: boolean) => void;
|
|
326
344
|
onReady?: () => void;
|
|
345
|
+
/** Maps each palette color (primary, secondary and tertiary, after the harmony rotation) before the
|
|
346
|
+
* theme derives anything from it, for an app that wants its whole palette toned, e.g.
|
|
347
|
+
* `getChalkboardColor` (marker in light mode, chalk in dark). The stored seed stays the player's
|
|
348
|
+
* raw pick, so nothing compounds on save, and `AutoPalettePicker` previews its swatches through
|
|
349
|
+
* the same tone. onColor/onContainer follow the toned colors by the usual light/dark split, so a
|
|
350
|
+
* tone decides their polarity: chalk's luminance floor is what gives its pastels dark text.
|
|
351
|
+
* Signal colors (success, warning, danger, MD3's error) are never toned. Must be referentially stable (a module-level
|
|
352
|
+
* function): the theme recomputes whenever it changes. Omit for the untoned palette. */
|
|
353
|
+
paletteTone?: PaletteTone;
|
|
327
354
|
/** Injects react-native-reanimated so `<Dialog animatedStyle={...}>` (e.g. from `useAnimatedStyle()`) can animate its card on the UI thread. Pass `import Reanimated from 'react-native-reanimated'`; omit to keep Dialog's `animatedStyle` prop a no-op. */
|
|
328
355
|
reanimated?: ReanimatedModule;
|
|
329
356
|
/** Renders React Native's `StatusBar`, styled from the theme (here and in `Appbar.Header`). Default true. Pass false
|
|
@@ -334,7 +361,7 @@ type ProviderProps = {
|
|
|
334
361
|
statusBarProps?: StatusBarProps;
|
|
335
362
|
style?: StyleProp<ViewStyle>;
|
|
336
363
|
};
|
|
337
|
-
declare function Provider({ children, defaults, expoBlur, fontFamily, initialValue, maskedView, navigationBar, onChange, onNavBarChange, onReady, reanimated, statusBar, statusBarProps, style }: ProviderProps): react.JSX.Element;
|
|
364
|
+
declare function Provider({ children, defaults, expoBlur, fontFamily, initialValue, maskedView, navigationBar, onChange, onNavBarChange, onReady, paletteTone, reanimated, statusBar, statusBarProps, style }: ProviderProps): react.JSX.Element;
|
|
338
365
|
|
|
339
366
|
declare const useAutoPaperTheme: () => AutoPaperTheme;
|
|
340
367
|
|
|
@@ -391,8 +418,19 @@ type ColorRoles = {
|
|
|
391
418
|
};
|
|
392
419
|
declare const getColorRoles: (base: string, surface: string, containerAlpha?: number) => ColorRoles;
|
|
393
420
|
|
|
421
|
+
declare const getLuminance: (value: string) => number;
|
|
422
|
+
declare const getContrastRatio: (a: string, b: string) => number;
|
|
423
|
+
|
|
394
424
|
declare const getHex: (value: string) => string | null;
|
|
395
425
|
|
|
426
|
+
type Oklch = {
|
|
427
|
+
l: number;
|
|
428
|
+
c: number;
|
|
429
|
+
h: number;
|
|
430
|
+
};
|
|
431
|
+
declare const getOklch: (value: string) => Oklch | null;
|
|
432
|
+
declare const getOklchHex: ({ l, c, h }: Oklch) => string;
|
|
433
|
+
|
|
396
434
|
type RGB = {
|
|
397
435
|
r: number;
|
|
398
436
|
g: number;
|
|
@@ -413,4 +451,4 @@ declare const isDarkColor: (value: string) => boolean;
|
|
|
413
451
|
|
|
414
452
|
declare const resolveSeedColor: (color: string | TriadicPalette) => string;
|
|
415
453
|
|
|
416
|
-
export { Appbar, type AppearanceIcons, AppearancePicker, AutoAppearancePicker, AutoPalettePicker, type AutoPaperTheme, BlurView, type BlurViewProps, BottomNavigation, Button, Chip, type ChipProps, type ColorHarmony, ColorPicker, type ColorRoles, Dialog, type DialogProps, type ExpoBlurModule, type ExpoNavigationBarModule, FAB, FadingScrollView, type FadingScrollViewProps, HarmonyPicker, IconButton, type IconButtonProps, type MaskedViewModule, Menu, type MenuProps, PalettePicker, type PaletteWeights, type PaperDefaults, Provider, type ProviderProps, type RGB, type ReanimatedModule, SCROLL_FADE_HEIGHT, SEMANTIC_BASE_COLORS, type SeedColor, type SemanticColorRoles, TextInput, type ThemeAppearance, type ThemeBridgeProps, type ThemeSettings, ThemeSettingsContext, type ThemeSettingsContextType, type ThemeState, type TriadicPalette, createThemeReducer, defaultColors, defaultThemeSettings, getBlendedColor, getColorRoles, getContrastColor, getHex, getRgb, getThirdColor, getTintTextColor, getTonalColor, getTriadicPalette, isDarkColor, resolveSeedColor, selectThemeAppearance, selectThemeBlur, selectThemeColor, selectThemeHarmony, themeActions, themeReducer, useAutoPaperTheme, useBlur, useBlurModule, useComputedTheme, useMaskedViewModule, useNavBarContext, usePaperDefaults, useReanimatedModule, useThemeBridgeProps, useThemeSettings };
|
|
454
|
+
export { Appbar, type AppearanceIcons, AppearancePicker, AutoAppearancePicker, AutoPalettePicker, type AutoPaperTheme, BlurView, type BlurViewProps, BottomNavigation, Button, type ChalkboardToneOptions, Chip, type ChipProps, type ColorHarmony, ColorPicker, type ColorRoles, Dialog, type DialogProps, type ExpoBlurModule, type ExpoNavigationBarModule, FAB, FadingScrollView, type FadingScrollViewProps, HarmonyPicker, IconButton, type IconButtonProps, type MaskedViewModule, Menu, type MenuProps, type Oklch, PalettePicker, type PaletteTone, type PaletteWeights, type PaperDefaults, Provider, type ProviderProps, type RGB, type ReanimatedModule, SCROLL_FADE_HEIGHT, SEMANTIC_BASE_COLORS, type SeedColor, type SemanticColorRoles, TextInput, type ThemeAppearance, type ThemeBridgeProps, type ThemeSettings, ThemeSettingsContext, type ThemeSettingsContextType, type ThemeState, type TriadicPalette, createChalkboardTone, createThemeReducer, defaultColors, defaultThemeSettings, getBlendedColor, getChalkboardColor, getColorRoles, getContrastColor, getContrastRatio, getHex, getLuminance, getOklch, getOklchHex, getRgb, getThirdColor, getTintTextColor, getTonalColor, getTriadicPalette, isDarkColor, resolveSeedColor, selectThemeAppearance, selectThemeBlur, selectThemeColor, selectThemeHarmony, themeActions, themeReducer, useAutoPaperTheme, useBlur, useBlurModule, useComputedTheme, useMaskedViewModule, useNavBarContext, usePaletteTone, usePaperDefaults, useReanimatedModule, useThemeBridgeProps, useThemeSettings };
|
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,22 @@ declare const Appbar: {
|
|
|
22
22
|
BackAction: react_native_paper_lib_typescript_utils_forwardRef.ForwardRefComponent<react_native.View, react_native_paper.AppbarBackActionProps>;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
+
type PaletteTone = (color: string, dark: boolean) => string;
|
|
26
|
+
type ChalkboardToneOptions = {
|
|
27
|
+
marker?: {
|
|
28
|
+
maxLightness?: number;
|
|
29
|
+
chroma?: number;
|
|
30
|
+
};
|
|
31
|
+
chalk?: {
|
|
32
|
+
lightness?: number;
|
|
33
|
+
lift?: number;
|
|
34
|
+
chroma?: number;
|
|
35
|
+
minLuminance?: number;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
declare const createChalkboardTone: (options?: ChalkboardToneOptions) => PaletteTone;
|
|
39
|
+
declare const getChalkboardColor: PaletteTone;
|
|
40
|
+
|
|
25
41
|
type ColorHarmony = 'triadic' | 'split-complementary' | 'analogous' | 'square' | 'complementary' | 'double-split';
|
|
26
42
|
type TriadicPalette = {
|
|
27
43
|
primary: string;
|
|
@@ -53,7 +69,7 @@ type SemanticColorRoles = {
|
|
|
53
69
|
type AutoPaperTheme = Omit<MD3Theme, 'colors'> & {
|
|
54
70
|
colors: MD3Theme['colors'] & SemanticColorRoles;
|
|
55
71
|
};
|
|
56
|
-
declare function useComputedTheme(appearance: ThemeAppearance, color: string | TriadicPalette, harmony?: ColorHarmony): AutoPaperTheme | null;
|
|
72
|
+
declare function useComputedTheme(appearance: ThemeAppearance, color: string | TriadicPalette, harmony?: ColorHarmony, paletteTone?: PaletteTone): AutoPaperTheme | null;
|
|
57
73
|
|
|
58
74
|
type AppearanceIcons = Partial<Record<ThemeAppearance, string>>;
|
|
59
75
|
type Props$5 = {
|
|
@@ -96,8 +112,9 @@ type Props$2 = {
|
|
|
96
112
|
weights?: PaletteWeights;
|
|
97
113
|
colors?: SeedColor[];
|
|
98
114
|
blur?: boolean;
|
|
115
|
+
previewColor?: (color: string) => string;
|
|
99
116
|
};
|
|
100
|
-
declare const PalettePicker: ({ value, onChange, harmony, onHarmonyChange, weights, colors, blur: blurProp }: Props$2) => react.JSX.Element;
|
|
117
|
+
declare const PalettePicker: ({ value, onChange, harmony, onHarmonyChange, weights, colors, blur: blurProp, previewColor }: Props$2) => react.JSX.Element;
|
|
101
118
|
|
|
102
119
|
type Props$1 = {
|
|
103
120
|
weights?: PaletteWeights;
|
|
@@ -305,6 +322,7 @@ declare const useNavBarContext: () => NavBarContextType;
|
|
|
305
322
|
declare const useBlurModule: () => ExpoBlurModule | undefined;
|
|
306
323
|
declare const useReanimatedModule: () => ReanimatedModule | undefined;
|
|
307
324
|
declare const useMaskedViewModule: () => MaskedViewModule | undefined;
|
|
325
|
+
declare const usePaletteTone: () => PaletteTone | undefined;
|
|
308
326
|
type ProviderProps = {
|
|
309
327
|
children: ReactNode;
|
|
310
328
|
defaults?: PaperDefaults;
|
|
@@ -324,6 +342,15 @@ type ProviderProps = {
|
|
|
324
342
|
onChange?: (settings: ThemeSettings) => void;
|
|
325
343
|
onNavBarChange?: (color: string, dark: boolean) => void;
|
|
326
344
|
onReady?: () => void;
|
|
345
|
+
/** Maps each palette color (primary, secondary and tertiary, after the harmony rotation) before the
|
|
346
|
+
* theme derives anything from it, for an app that wants its whole palette toned, e.g.
|
|
347
|
+
* `getChalkboardColor` (marker in light mode, chalk in dark). The stored seed stays the player's
|
|
348
|
+
* raw pick, so nothing compounds on save, and `AutoPalettePicker` previews its swatches through
|
|
349
|
+
* the same tone. onColor/onContainer follow the toned colors by the usual light/dark split, so a
|
|
350
|
+
* tone decides their polarity: chalk's luminance floor is what gives its pastels dark text.
|
|
351
|
+
* Signal colors (success, warning, danger, MD3's error) are never toned. Must be referentially stable (a module-level
|
|
352
|
+
* function): the theme recomputes whenever it changes. Omit for the untoned palette. */
|
|
353
|
+
paletteTone?: PaletteTone;
|
|
327
354
|
/** Injects react-native-reanimated so `<Dialog animatedStyle={...}>` (e.g. from `useAnimatedStyle()`) can animate its card on the UI thread. Pass `import Reanimated from 'react-native-reanimated'`; omit to keep Dialog's `animatedStyle` prop a no-op. */
|
|
328
355
|
reanimated?: ReanimatedModule;
|
|
329
356
|
/** Renders React Native's `StatusBar`, styled from the theme (here and in `Appbar.Header`). Default true. Pass false
|
|
@@ -334,7 +361,7 @@ type ProviderProps = {
|
|
|
334
361
|
statusBarProps?: StatusBarProps;
|
|
335
362
|
style?: StyleProp<ViewStyle>;
|
|
336
363
|
};
|
|
337
|
-
declare function Provider({ children, defaults, expoBlur, fontFamily, initialValue, maskedView, navigationBar, onChange, onNavBarChange, onReady, reanimated, statusBar, statusBarProps, style }: ProviderProps): react.JSX.Element;
|
|
364
|
+
declare function Provider({ children, defaults, expoBlur, fontFamily, initialValue, maskedView, navigationBar, onChange, onNavBarChange, onReady, paletteTone, reanimated, statusBar, statusBarProps, style }: ProviderProps): react.JSX.Element;
|
|
338
365
|
|
|
339
366
|
declare const useAutoPaperTheme: () => AutoPaperTheme;
|
|
340
367
|
|
|
@@ -391,8 +418,19 @@ type ColorRoles = {
|
|
|
391
418
|
};
|
|
392
419
|
declare const getColorRoles: (base: string, surface: string, containerAlpha?: number) => ColorRoles;
|
|
393
420
|
|
|
421
|
+
declare const getLuminance: (value: string) => number;
|
|
422
|
+
declare const getContrastRatio: (a: string, b: string) => number;
|
|
423
|
+
|
|
394
424
|
declare const getHex: (value: string) => string | null;
|
|
395
425
|
|
|
426
|
+
type Oklch = {
|
|
427
|
+
l: number;
|
|
428
|
+
c: number;
|
|
429
|
+
h: number;
|
|
430
|
+
};
|
|
431
|
+
declare const getOklch: (value: string) => Oklch | null;
|
|
432
|
+
declare const getOklchHex: ({ l, c, h }: Oklch) => string;
|
|
433
|
+
|
|
396
434
|
type RGB = {
|
|
397
435
|
r: number;
|
|
398
436
|
g: number;
|
|
@@ -413,4 +451,4 @@ declare const isDarkColor: (value: string) => boolean;
|
|
|
413
451
|
|
|
414
452
|
declare const resolveSeedColor: (color: string | TriadicPalette) => string;
|
|
415
453
|
|
|
416
|
-
export { Appbar, type AppearanceIcons, AppearancePicker, AutoAppearancePicker, AutoPalettePicker, type AutoPaperTheme, BlurView, type BlurViewProps, BottomNavigation, Button, Chip, type ChipProps, type ColorHarmony, ColorPicker, type ColorRoles, Dialog, type DialogProps, type ExpoBlurModule, type ExpoNavigationBarModule, FAB, FadingScrollView, type FadingScrollViewProps, HarmonyPicker, IconButton, type IconButtonProps, type MaskedViewModule, Menu, type MenuProps, PalettePicker, type PaletteWeights, type PaperDefaults, Provider, type ProviderProps, type RGB, type ReanimatedModule, SCROLL_FADE_HEIGHT, SEMANTIC_BASE_COLORS, type SeedColor, type SemanticColorRoles, TextInput, type ThemeAppearance, type ThemeBridgeProps, type ThemeSettings, ThemeSettingsContext, type ThemeSettingsContextType, type ThemeState, type TriadicPalette, createThemeReducer, defaultColors, defaultThemeSettings, getBlendedColor, getColorRoles, getContrastColor, getHex, getRgb, getThirdColor, getTintTextColor, getTonalColor, getTriadicPalette, isDarkColor, resolveSeedColor, selectThemeAppearance, selectThemeBlur, selectThemeColor, selectThemeHarmony, themeActions, themeReducer, useAutoPaperTheme, useBlur, useBlurModule, useComputedTheme, useMaskedViewModule, useNavBarContext, usePaperDefaults, useReanimatedModule, useThemeBridgeProps, useThemeSettings };
|
|
454
|
+
export { Appbar, type AppearanceIcons, AppearancePicker, AutoAppearancePicker, AutoPalettePicker, type AutoPaperTheme, BlurView, type BlurViewProps, BottomNavigation, Button, type ChalkboardToneOptions, Chip, type ChipProps, type ColorHarmony, ColorPicker, type ColorRoles, Dialog, type DialogProps, type ExpoBlurModule, type ExpoNavigationBarModule, FAB, FadingScrollView, type FadingScrollViewProps, HarmonyPicker, IconButton, type IconButtonProps, type MaskedViewModule, Menu, type MenuProps, type Oklch, PalettePicker, type PaletteTone, type PaletteWeights, type PaperDefaults, Provider, type ProviderProps, type RGB, type ReanimatedModule, SCROLL_FADE_HEIGHT, SEMANTIC_BASE_COLORS, type SeedColor, type SemanticColorRoles, TextInput, type ThemeAppearance, type ThemeBridgeProps, type ThemeSettings, ThemeSettingsContext, type ThemeSettingsContextType, type ThemeState, type TriadicPalette, createChalkboardTone, createThemeReducer, defaultColors, defaultThemeSettings, getBlendedColor, getChalkboardColor, getColorRoles, getContrastColor, getContrastRatio, getHex, getLuminance, getOklch, getOklchHex, getRgb, getThirdColor, getTintTextColor, getTonalColor, getTriadicPalette, isDarkColor, resolveSeedColor, selectThemeAppearance, selectThemeBlur, selectThemeColor, selectThemeHarmony, themeActions, themeReducer, useAutoPaperTheme, useBlur, useBlurModule, useComputedTheme, useMaskedViewModule, useNavBarContext, usePaletteTone, usePaperDefaults, useReanimatedModule, useThemeBridgeProps, useThemeSettings };
|