@saas-ui/palette
Version:
Color palette generator for Chakra UI
73 lines (50 loc) • 1.12 kB
Markdown
Color palette generator for Chakra UI
This library creates a color object based on a single input color. The object can be directly used to extend your Chakra theme.
```sh
$ yarn add @saas-ui/palette
$ npm i @saas-ui/palette --save
```
1. Setup your Chakra theme, [Theme documentation](https://chakra-ui.com/docs/theming/theme)
2. Create your palette
```jsx theme.jsx
import { extendTheme } from '@chakra-ui/react'
import { createPalette } from '@saas-ui/palette'
const colors = createPalette('#6d28d9')
const theme = extendTheme({
colors,
})
export default theme
```
```jsx
const colors = createPalette('#6d28d9', {
blackLuminance: 0.005, // defaults to 0
colors: {
red: '#d00b00', // override default colors
indigo: '#4B0082', // add custom colors
},
})
```
```js
const colors = [
'red',
'orange',
'yellow',
'green',
'teal',
'cyan',
'blue',
'purple',
'pink',
]
```
This library was inspired by https://palx.jxnblk.com/
MIT - Appulse Software