Created
May 8, 2022 18:13
-
-
Save sachaarbonel/55496f06c81f619fad12e5d5604a5a11 to your computer and use it in GitHub Desktop.
Random pastel color in Dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Color randomPastelColor(){ | |
final saturation = 0.4 | |
final lightness = 0.9 | |
final alpha = 1.0 | |
final hue = Random().nextDouble(); | |
final hsl = HSLColor(alpha, hue, saturation, lightness); | |
return hsl.toColor(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment