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.

Revisions

  1. lifenautjoe created this gist Dec 13, 2018.
    11 changes: 11 additions & 0 deletions random_hex_color.dart
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    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;
    }