mirror of
https://github.com/immich-app/immich.git
synced 2025-08-11 09:16:31 -04:00
* chore: bump dart sdk to 3.8 * chore: make build * make pigeon * chore: format files --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
17 lines
545 B
Dart
17 lines
545 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
extension ImmichColorSchemeExtensions on ColorScheme {
|
|
bool get _isDarkMode => brightness == Brightness.dark;
|
|
Color get onSurfaceSecondary => _isDarkMode ? onSurface.darken(amount: .3) : onSurface.lighten(amount: .3);
|
|
}
|
|
|
|
extension ColorExtensions on Color {
|
|
Color lighten({double amount = 0.1}) {
|
|
return Color.alphaBlend(Colors.white.withValues(alpha: amount), this);
|
|
}
|
|
|
|
Color darken({double amount = 0.1}) {
|
|
return Color.alphaBlend(Colors.black.withValues(alpha: amount), this);
|
|
}
|
|
}
|