Created
December 1, 2019 10:04
-
-
Save mmazzarolo/53c246d122514c1cb17ffa418165aac9 to your computer and use it in GitHub Desktop.
Ordinary Puzzles grayscale palette
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tinycolor from "tinycolor2"; | |
import { useColorScheme } from "react-native-appearance"; | |
const primaryColor = "#171520"; | |
const palette = new Array(10).fill(primaryColor).map((color, index) => | |
tinycolor(color) | |
.brighten(index * 10) | |
.toString() | |
); | |
const lightColors = palette; | |
const darkColors = palette.slice().reverse(); | |
export const useColors = function() { | |
const colorScheme = useColorScheme(); | |
const colors = { | |
primary: colorScheme === "dark" ? darkColors : lightColors | |
}; | |
return colors; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage: