From 0ed3b9817c7b978e5cf0a8789c7dc59c0b7a2033 Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Wed, 2 Nov 2022 12:36:48 +1300 Subject: [PATCH] Add lighter purple color option --- App.tsx | 3 --- MassiveFab.tsx | 4 +--- SettingsPage.tsx | 6 +++--- colors.ts | 16 ++++++---------- migrations/1667186320954-add-color.ts | 2 +- 5 files changed, 11 insertions(+), 20 deletions(-) diff --git a/App.tsx b/App.tsx index b265133..490baac 100644 --- a/App.tsx +++ b/App.tsx @@ -13,7 +13,6 @@ import { Snackbar, } from 'react-native-paper' import MaterialIcon from 'react-native-vector-icons/MaterialIcons' -import {lightColors} from './colors' import {AppDataSource} from './data-source' import {settingsRepo} from './db' import Routes from './Routes' @@ -35,8 +34,6 @@ export const CombinedDarkTheme = { colors: { ...NavigationDarkTheme.colors, ...PaperDarkTheme.colors, - primary: lightColors[0].hex, - background: '#0E0E0E', }, } diff --git a/MassiveFab.tsx b/MassiveFab.tsx index ec3a5d6..38a3e74 100644 --- a/MassiveFab.tsx +++ b/MassiveFab.tsx @@ -6,9 +6,7 @@ import {lightColors} from './colors' export default function MassiveFab(props: Partial>) { const {colors} = useTheme() - const fabColor = lightColors - .map(lightColor => lightColor.hex) - .includes(colors.primary) + const fabColor = lightColors.includes(colors.primary) ? CombinedDarkTheme.colors.background : CombinedDefaultTheme.colors.background diff --git a/SettingsPage.tsx b/SettingsPage.tsx index 427ab71..ef348cb 100644 --- a/SettingsPage.tsx +++ b/SettingsPage.tsx @@ -202,10 +202,10 @@ export default function SettingsPage() { diff --git a/colors.ts b/colors.ts index 8ac11ee..ad24629 100644 --- a/colors.ts +++ b/colors.ts @@ -1,16 +1,12 @@ export const lightColors = [ - {hex: '#B3E5FC', name: 'Cyan'}, - {hex: '#FA8072', name: 'Salmon'}, - {hex: '#FFC0CB', name: 'Pink'}, - {hex: '#E9DCC9', name: 'Linen'}, + '#B3E5FC', + '#FA8072', + '#FFC0CB', + '#E9DCC9', + '#BBA1CE', ] -export const darkColors = [ - {hex: '#8156A7', name: 'Purple'}, - {hex: '#007AFF', name: 'Blue'}, - {hex: '#000000', name: 'Black'}, - {hex: '#CD5C5C', name: 'Red'}, -] +export const darkColors = ['#8156A7', '#007AFF', '#000000', '#CD5C5C'] export const colorShade = (color: any, amount: number) => { color = color.replace(/^#/, '') diff --git a/migrations/1667186320954-add-color.ts b/migrations/1667186320954-add-color.ts index d1b64c3..52534a9 100644 --- a/migrations/1667186320954-add-color.ts +++ b/migrations/1667186320954-add-color.ts @@ -10,7 +10,7 @@ export class addColor1667186320954 implements MigrationInterface { name: 'color', type: 'text', isNullable: false, - default: `'${darkColors[0].hex}'`, + default: `'${darkColors[0]}'`, }), ) .catch(console.error)