๐Ÿ“ฆ j-piasecki / expo-material-dynamic-colors

โ˜… 4 stars โ‘‚ 0 forks ๐Ÿ‘ 4 watching โš–๏ธ MIT License
๐Ÿ“ฅ Clone https://github.com/j-piasecki/expo-material-dynamic-colors.git
HTTPS git clone https://github.com/j-piasecki/expo-material-dynamic-colors.git
SSH git clone git@github.com:j-piasecki/expo-material-dynamic-colors.git
CLI gh repo clone j-piasecki/expo-material-dynamic-colors
Jakub Piasecki Jakub Piasecki Set version 5a96aaa 5 months ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ android
๐Ÿ“ example
๐Ÿ“ src
๐Ÿ“„ .eslintrc.js
๐Ÿ“„ .gitignore
๐Ÿ“„ .npmignore
๐Ÿ“„ LICENSE
๐Ÿ“„ package-lock.json
๐Ÿ“„ package.json
๐Ÿ“„ README.md
๐Ÿ“„ tsconfig.json
๐Ÿ“„ README.md

expo-material-dynamic-colors

A module providing access to the dynamic material 3 colors on Android.

API

MATERIAL_YOU_SUPPORTED

A boolean value which is true when the device supports dynamic material theming and false otherwise.

useMaterialPalette

On Android returns the dynamic color palette:

export interface MaterialPalette {
  systemAccent1: string[]
  systemAccent2: string[]
  systemAccent3: string[]
  systemNeutral1: string[]
  systemNeutral2: string[]
}

On other platforms returns null.

useMaterialTheme

On Android returns the color theme built upon the color palette:

export interface MaterialColors {
  primary: string
  onPrimary: string
  primaryContainer: string
  onPrimaryContainer: string

  secondary: string
  onSecondary: string
  secondaryContainer: string
  onSecondaryContainer: string

  tertiary: string
  onTertiary: string
  tertiaryContainer: string
  onTertiaryContainer: string

  error: string
  onError: string
  errorContainer: string
  onErrorContainer: string

  surfaceDim: string
  surface: string
  surfaceBright: string
  surfaceContainerLowest: string
  surfaceContainerLow: string
  surfaceContainer: string
  surfaceContainerHigh: string
  surfaceContainerHighest: string

  onSurface: string
  onSurfaceVariant: string
  outline: string
  outlineVariant: string

  inverseSurface: string
  inversePrimary: string
  inverseOnSurface: string
}

On other platforms returns null.