Massive/colors.ts

23 lines
713 B
TypeScript
Raw Normal View History

import { DefaultTheme, MD3DarkTheme } from "react-native-paper";
2022-09-25 04:32:49 +00:00
export const lightColors = [
{ hex: MD3DarkTheme.colors.primary, name: "Purple" },
{ hex: "#B3E5FC", name: "Blue" },
{ hex: "#FA8072", name: "Salmon" },
{ hex: "#FFC0CB", name: "Pink" },
{ hex: "#E9DCC9", name: "Linen" },
];
2022-09-25 04:32:49 +00:00
export const darkColors = [
{ hex: DefaultTheme.colors.primary, name: "Purple" },
{ hex: "#0051a9", name: "Blue" },
{ hex: "#000000", name: "Black" },
{ hex: "#863c3c", name: "Red" },
{ hex: "#1c6000", name: "Kermit" },
];
export function darkenRgba(rgba: string, amount: number) {
let [r, g, b, a] = rgba.match(/\d+/g).map(Number);
return `rgba(${r}, ${g}, ${b}, ${Math.max(0, a - amount)})`;
}