mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-18 01:49:50 +01:00
13 lines
307 B
Dart
13 lines
307 B
Dart
|
import 'package:flutter/material.dart';
|
||
|
|
||
|
extension StringColor on String {
|
||
|
Color get color {
|
||
|
double number = 0.0;
|
||
|
for (var i = 0; i < this.length; i++) {
|
||
|
number += this.codeUnitAt(i);
|
||
|
}
|
||
|
number = (number % 10) * 25.5;
|
||
|
return HSLColor.fromAHSL(1, number, 1, 0.35).toColor();
|
||
|
}
|
||
|
}
|