Merge pull request #1132 from richardshiue/fix-blue-tint

Fix blue tint
This commit is contained in:
Nathan.fooo 2022-09-25 09:32:04 +08:00 committed by GitHub
commit a1b54e0646
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -104,7 +104,7 @@ class AppTheme {
..tint6 = const Color(0xfff5ffdc)
..tint7 = const Color(0xffddffd6)
..tint8 = const Color(0xffdefff1)
..tint9 = const Color(0xffdefff1)
..tint9 = const Color(0xffe1fbff)
..main1 = const Color(0xff00bcf0)
..main2 = const Color(0xff00b7ea)
..textColor = _black
@ -152,7 +152,8 @@ class AppTheme {
ThemeData get themeData {
var t = ThemeData(
textTheme: TextTheme(bodyText2: TextStyle(color: textColor)),
textSelectionTheme: TextSelectionThemeData(cursorColor: main2, selectionHandleColor: main2),
textSelectionTheme: TextSelectionThemeData(
cursorColor: main2, selectionHandleColor: main2),
primaryIconTheme: IconThemeData(color: hover),
iconTheme: IconThemeData(color: shader1),
canvasColor: shader6,
@ -179,7 +180,8 @@ class AppTheme {
toggleableActiveColor: main1);
}
Color shift(Color c, double d) => ColorUtils.shiftHsl(c, d * (isDark ? -1 : 1));
Color shift(Color c, double d) =>
ColorUtils.shiftHsl(c, d * (isDark ? -1 : 1));
}
class ColorUtils {
@ -188,14 +190,18 @@ class ColorUtils {
return hslc.withLightness((hslc.lightness + amt).clamp(0.0, 1.0)).toColor();
}
static Color parseHex(String value) => Color(int.parse(value.substring(1, 7), radix: 16) + 0xFF000000);
static Color parseHex(String value) =>
Color(int.parse(value.substring(1, 7), radix: 16) + 0xFF000000);
static Color blend(Color dst, Color src, double opacity) {
return Color.fromARGB(
255,
(dst.red.toDouble() * (1.0 - opacity) + src.red.toDouble() * opacity).toInt(),
(dst.green.toDouble() * (1.0 - opacity) + src.green.toDouble() * opacity).toInt(),
(dst.blue.toDouble() * (1.0 - opacity) + src.blue.toDouble() * opacity).toInt(),
(dst.red.toDouble() * (1.0 - opacity) + src.red.toDouble() * opacity)
.toInt(),
(dst.green.toDouble() * (1.0 - opacity) + src.green.toDouble() * opacity)
.toInt(),
(dst.blue.toDouble() * (1.0 - opacity) + src.blue.toDouble() * opacity)
.toInt(),
);
}
}