Massive/colors.ts
Brandon Presley a9b69638a6 Fix color of progress bar in Timer page
React native paper update made the dark theme color into RGBA
instead of hex, so adding the string '80' no longer works.
2023-08-22 12:04:47 +12:00

23 lines
713 B
TypeScript

import { DefaultTheme, MD3DarkTheme } from "react-native-paper";
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" },
];
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)})`;
}