Skip to content

Instantly share code, notes, and snippets.

@lifenautjoe
Created December 13, 2018 16:08
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lifenautjoe/d012dd2e5c24e93b0a16aff7be7280a8 to your computer and use it in GitHub Desktop.
Save lifenautjoe/d012dd2e5c24e93b0a16aff7be7280a8 to your computer and use it in GitHub Desktop.
Random Hex Color Dart
import 'dart:math';
Random random = new Random();
String generateRandomHexColor(){
int length = 6;
String chars = '0123456789ABCDEF';
String hex = '#';
while(length-- > 0) hex += chars[(random.nextInt(16)) | 0];
return hex;
}
@navidshad
Copy link

thank you for your solution. it's useful for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment