randomColorSchemeLight function
Generates a random Color Scheme with a light theme.
Properties set: primary, primaryVariant, secondary, surface, background
Input: an optional seed for the Random function.
Input: an option bool to enable/disable printing to console Output: a random ColorScheme.
Implementation
ColorScheme randomColorSchemeLight({int? seed, bool shouldPrint = true}) {
final colors = _getRandomMaterialLight(seed: seed);
if (shouldPrint) {
print('''
ColorScheme.light(
primary: ${colors[_kPrimary]!.toColor()},
primaryContainer: ${colors[_kPrimaryContainer]!.toColor()},
secondary: ${colors[_kSecondary]!.toColor()},
secondaryContainer: ${colors[_kSecondaryContainer]!.toColor()},
surface: ${colors[_kSurface]!.toColor()},
background: ${colors[_kBackground]!.toColor()},
)
''');
}
return ColorScheme.light(
primary: colors[_kPrimary]!.toColor(),
primaryContainer: colors[_kPrimaryContainer]!.toColor(),
secondary: colors[_kSecondary]!.toColor(),
secondaryContainer: colors[_kSecondaryContainer]!.toColor(),
surface: colors[_kSurface]!.toColor(),
background: colors[_kBackground]!.toColor(),
);
}