Skip to content

Commit

Permalink
Merge pull request #3 from CLucera/main
Browse files Browse the repository at this point in the history
chore: Update for latest colorscheme variables
  • Loading branch information
bernaferrari authored Jul 9, 2024
2 parents fb11ebc + c13ef2c commit d094dd1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ In your project, just wrap the `ColorScheme.dark(...)` with `colorBlindnessColor

```dart
import 'package:color_blindness/color_blindness.dart';
import 'package:color_blindness/color_blindness_color_scheme.dart';
Theme(
data: ThemeData(
Expand Down
2 changes: 1 addition & 1 deletion lib/color_blindness.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'dart:ui';

export 'package:color_blindness/color_blindness_color_scheme.dart';
/// The color blindness types.
/// Type [none] is included as a convenience.
enum ColorBlindnessType {
Expand Down
32 changes: 28 additions & 4 deletions lib/color_blindness_color_scheme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,57 @@ ColorScheme colorBlindnessColorScheme(
ColorBlindnessType type,
) {
return ColorScheme(
brightness: scheme.brightness,
primary: colorBlindness(scheme.primary, type),
onPrimary: colorBlindness(scheme.onPrimary, type),
primaryContainer: colorBlindness(scheme.primaryContainer, type),
onPrimaryContainer: colorBlindness(scheme.onPrimaryContainer, type),
primaryFixed: colorBlindness(scheme.primaryFixed, type),
primaryFixedDim: colorBlindness(scheme.primaryFixedDim, type),
onPrimaryFixed: colorBlindness(scheme.onPrimaryFixed, type),
onPrimaryFixedVariant: colorBlindness(scheme.onPrimaryFixedVariant, type),
secondary: colorBlindness(scheme.secondary, type),
onSecondary: colorBlindness(scheme.onSecondary, type),
secondaryContainer: colorBlindness(scheme.secondaryContainer, type),
onSecondaryContainer: colorBlindness(scheme.onSecondaryContainer, type),
secondaryFixed: colorBlindness(scheme.secondaryFixed, type),
secondaryFixedDim: colorBlindness(scheme.secondaryFixedDim, type),
onSecondaryFixed: colorBlindness(scheme.onSecondaryFixed, type),
onSecondaryFixedVariant:
colorBlindness(scheme.onSecondaryFixedVariant, type),
tertiary: colorBlindness(scheme.tertiary, type),
onTertiary: colorBlindness(scheme.onTertiary, type),
tertiaryContainer: colorBlindness(scheme.tertiaryContainer, type),
onTertiaryContainer: colorBlindness(scheme.onTertiaryContainer, type),
tertiaryFixed: colorBlindness(scheme.tertiaryFixed, type),
tertiaryFixedDim: colorBlindness(scheme.tertiaryFixedDim, type),
onTertiaryFixed: colorBlindness(scheme.onTertiaryFixed, type),
onTertiaryFixedVariant: colorBlindness(scheme.onTertiaryFixedVariant, type),
error: colorBlindness(scheme.error, type),
onError: colorBlindness(scheme.onError, type),
errorContainer: colorBlindness(scheme.errorContainer, type),
onErrorContainer: colorBlindness(scheme.onErrorContainer, type),
background: colorBlindness(scheme.background, type),
onBackground: colorBlindness(scheme.onBackground, type),
surface: colorBlindness(scheme.surface, type),
surfaceVariant: colorBlindness(scheme.surfaceVariant, type),
onSurface: colorBlindness(scheme.onSurface, type),
surfaceDim: colorBlindness(scheme.surfaceDim, type),
surfaceBright: colorBlindness(scheme.surfaceBright, type),
surfaceContainerLowest: colorBlindness(scheme.surfaceContainerLowest, type),
surfaceContainerLow: colorBlindness(scheme.surfaceContainerLow, type),
surfaceContainer: colorBlindness(scheme.surfaceContainer, type),
surfaceContainerHigh: colorBlindness(scheme.surfaceContainerHigh, type),
surfaceContainerHighest:
colorBlindness(scheme.surfaceContainerHighest, type),
onSurfaceVariant: colorBlindness(scheme.onSurfaceVariant, type),
outline: colorBlindness(scheme.outline, type),
outlineVariant: colorBlindness(scheme.outlineVariant, type),
shadow: colorBlindness(scheme.shadow, type),
scrim: colorBlindness(scheme.scrim, type),
inverseSurface: colorBlindness(scheme.inverseSurface, type),
onInverseSurface: colorBlindness(scheme.onInverseSurface, type),
inversePrimary: colorBlindness(scheme.inversePrimary, type),
brightness: scheme.brightness,
surfaceTint: colorBlindness(scheme.surfaceTint, type),
background: colorBlindness(scheme.background, type),
onBackground: colorBlindness(scheme.onBackground, type),
surfaceVariant: colorBlindness(scheme.surfaceVariant, type),
);
}

0 comments on commit d094dd1

Please sign in to comment.