notes page finished, messing with theme and navbar things
This commit is contained in:
22
refilc/lib/theme/colors/utils.dart
Normal file
22
refilc/lib/theme/colors/utils.dart
Normal file
@@ -0,0 +1,22 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ColorsUtils {
|
||||
Color darken(Color color, {double amount = .1}) {
|
||||
assert(amount >= 0 && amount <= 1);
|
||||
|
||||
final hsl = HSLColor.fromColor(color);
|
||||
final hslDark = hsl.withLightness((hsl.lightness - amount).clamp(0.0, 1.0));
|
||||
|
||||
return hslDark.toColor();
|
||||
}
|
||||
|
||||
Color lighten(Color color, {double amount = .1}) {
|
||||
assert(amount >= 0 && amount <= 1);
|
||||
|
||||
final hsl = HSLColor.fromColor(color);
|
||||
final hslLight =
|
||||
hsl.withLightness((hsl.lightness + amount).clamp(0.0, 1.0));
|
||||
|
||||
return hslLight.toColor();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user