Skip to content

Commit

Permalink
Get random color palettes
Browse files Browse the repository at this point in the history
  • Loading branch information
ozgrozer committed Jun 29, 2024
1 parent c100e42 commit 4427c7f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion components/Colors.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { useState, useEffect } from 'react'
import niceColors from 'nice-color-palettes'

import ntc from '@functions/ntc'
import styles from '@styles/Colors.module.scss'
import adjustTextColor from '@functions/adjustTextColor'

export default () => {
const colors = ['#a1e8af', '#94c595', '#747c92', '#372772', '#3a2449']
const [colors, setColors] = useState([])

useEffect(() => {
setColors(niceColors[Math.floor(Math.random() * niceColors.length)])
}, [])

return (
<div className={styles.colors}>
Expand Down

0 comments on commit 4427c7f

Please sign in to comment.