Skip to content

Commit

Permalink
(Re)merge branches
Browse files Browse the repository at this point in the history
  • Loading branch information
singularity-s0 committed Apr 28, 2021
1 parent d264af7 commit 85ffa66
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions lib/common/constant.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

import 'dart:math';

import 'package:dan_xi/generated/l10n.dart';
import 'package:event_bus/event_bus.dart';
import 'package:flutter/cupertino.dart';
Expand Down Expand Up @@ -89,7 +91,33 @@ class Constant {
),
);
}

static const List<String> TAG_COLOR_LIST = [
'red',
'pink',
'purple',
'deep-purple',
'indigo',
'blue',
'light-blue',
'cyan',
'teal',
'green',
'light-green',
'lime',
'yellow',
'amber',
'orange',
'deep-orange',
'brown',
'blue-grey',
'grey'
];

static String get randomColor =>
TAG_COLOR_LIST[Random().nextInt(TAG_COLOR_LIST.length)];

/// Get the [Color] from a color string.
static Color getColorFromString(String color) {
switch (color) {
case 'red':
Expand Down

0 comments on commit 85ffa66

Please sign in to comment.