Skip to content

Instantly share code, notes, and snippets.

@lifenautjoe
Created December 13, 2018 16:08
Show Gist options
  • Select an option

  • Save lifenautjoe/d012dd2e5c24e93b0a16aff7be7280a8 to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown

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