feat : button , outlined button
fab button , fab outlined button , input , pagination widget's
This commit is contained in:
24
lib/presentation/utils/color_utils.dart
Normal file
24
lib/presentation/utils/color_utils.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
extension ColorUtils on Color {
|
||||
Color _darken([double amount = 0.1]) {
|
||||
assert(amount >= 0 && amount <= 1, 'مقدار تیرگی باید بین 0 و 1 باشد');
|
||||
final hslColor = HSLColor.fromColor(this);
|
||||
final newLightness = (hslColor.lightness - amount).clamp(0.0, 1.0);
|
||||
final hslDarkerColor = hslColor.withLightness(newLightness);
|
||||
return hslDarkerColor.toColor();
|
||||
}
|
||||
|
||||
get disabledColor{
|
||||
return withAlpha(38);
|
||||
}
|
||||
|
||||
get hoverColor{
|
||||
return _darken(0.5);
|
||||
}
|
||||
|
||||
get pressedColor{
|
||||
return _darken(0.10);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user