feat(app): dark mode uses a near-black gray with lighter layers instead of pure black
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// The app's backgrounds. Dark mode uses a near-black gray rather than pure
|
||||
/// black, so cards, sections and bars read as layers above the page.
|
||||
abstract final class AppColors {
|
||||
/// A page.
|
||||
static const background = CupertinoDynamicColor.withBrightness(
|
||||
color: Color(0xFFFFFFFF),
|
||||
darkColor: Color(0xFF141416),
|
||||
);
|
||||
|
||||
/// Behind grouped sections (Settings-style lists).
|
||||
static const groupedBackground = CupertinoDynamicColor.withBrightness(
|
||||
color: Color(0xFFF2F2F7),
|
||||
darkColor: Color(0xFF141416),
|
||||
);
|
||||
|
||||
/// Bars over the page.
|
||||
static const bar = CupertinoDynamicColor.withBrightness(
|
||||
color: Color(0xF0F9F9F9),
|
||||
darkColor: Color(0xF01C1C1F),
|
||||
);
|
||||
}
|
||||
|
||||
const _seed = Color(0xFF6750A4);
|
||||
|
||||
ThemeData appLightTheme() =>
|
||||
ThemeData(colorScheme: ColorScheme.fromSeed(seedColor: _seed));
|
||||
|
||||
/// Material's dark scheme with gray surfaces stepping up from the page.
|
||||
ThemeData appDarkTheme() {
|
||||
final scheme =
|
||||
ColorScheme.fromSeed(
|
||||
seedColor: _seed,
|
||||
brightness: Brightness.dark,
|
||||
).copyWith(
|
||||
surface: const Color(0xFF141416),
|
||||
surfaceDim: const Color(0xFF141416),
|
||||
surfaceBright: const Color(0xFF3A3B40),
|
||||
surfaceContainerLowest: const Color(0xFF0F0F11),
|
||||
surfaceContainerLow: const Color(0xFF1B1C1F),
|
||||
surfaceContainer: const Color(0xFF202125),
|
||||
surfaceContainerHigh: const Color(0xFF27282C),
|
||||
surfaceContainerHighest: const Color(0xFF303136),
|
||||
);
|
||||
return ThemeData(
|
||||
colorScheme: scheme,
|
||||
scaffoldBackgroundColor: scheme.surface,
|
||||
);
|
||||
}
|
||||
|
||||
const appCupertinoTheme = CupertinoThemeData(
|
||||
scaffoldBackgroundColor: AppColors.background,
|
||||
barBackgroundColor: AppColors.bar,
|
||||
);
|
||||
Reference in New Issue
Block a user