Finally found a way from here.
Color lighten(Color color, [double amount = 0.49]) {
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();
}
Color hexToColor(String code) {
return Color(int.parse(code.substring(0, 6), radix: 16) + 0xFF000000);
}
And Im calling this fucntion like this.
backgroundColor: lighten(hexToColor("f98b5")),
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…