mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2024-08-21 12:31:51 +00:00
17 lines
418 B
Dart
17 lines
418 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
Color stringToColor(String string) {
|
|
var number = string.codeUnits.reduce((a, b) => a + b);
|
|
var index = number % colorPallete.length;
|
|
return colorPallete[index];
|
|
}
|
|
|
|
var originalColor = Color(0xFFDBD8BD);
|
|
var count = 40;
|
|
var colorPallete = List.generate(
|
|
count,
|
|
(index) => HSLColor.fromColor(originalColor)
|
|
.withHue((index) * 360.0 / count)
|
|
.toColor(),
|
|
);
|