feat(app): dark mode uses a near-black gray with lighter layers instead of pure black
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/ui/theme/app_theme.dart';
|
||||
|
||||
void main() {
|
||||
test('dark mode is a near-black gray, with lighter layers above it', () {
|
||||
final scheme = appDarkTheme().colorScheme;
|
||||
expect(scheme.surface, const Color(0xFF141416));
|
||||
expect(appDarkTheme().scaffoldBackgroundColor, scheme.surface);
|
||||
final steps = [
|
||||
scheme.surface,
|
||||
scheme.surfaceContainerLow,
|
||||
scheme.surfaceContainer,
|
||||
scheme.surfaceContainerHigh,
|
||||
scheme.surfaceContainerHighest,
|
||||
].map((color) => color.computeLuminance()).toList();
|
||||
for (var i = 1; i < steps.length; i++) {
|
||||
expect(steps[i], greaterThan(steps[i - 1]));
|
||||
}
|
||||
});
|
||||
|
||||
test('the Cupertino page is gray in dark mode and unchanged in light', () {
|
||||
expect(AppColors.background.darkColor, const Color(0xFF141416));
|
||||
expect(AppColors.background.color, const Color(0xFFFFFFFF));
|
||||
expect(appCupertinoTheme.scaffoldBackgroundColor, AppColors.background);
|
||||
expect(AppColors.groupedBackground.darkColor, isNot(CupertinoColors.black));
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user