mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
style: code auto-format
This commit is contained in:
parent
fc1535696b
commit
e5f5169a39
@ -152,7 +152,8 @@ class AppTheme {
|
|||||||
ThemeData get themeData {
|
ThemeData get themeData {
|
||||||
var t = ThemeData(
|
var t = ThemeData(
|
||||||
textTheme: TextTheme(bodyText2: TextStyle(color: textColor)),
|
textTheme: TextTheme(bodyText2: TextStyle(color: textColor)),
|
||||||
textSelectionTheme: TextSelectionThemeData(cursorColor: main2, selectionHandleColor: main2),
|
textSelectionTheme: TextSelectionThemeData(
|
||||||
|
cursorColor: main2, selectionHandleColor: main2),
|
||||||
primaryIconTheme: IconThemeData(color: hover),
|
primaryIconTheme: IconThemeData(color: hover),
|
||||||
iconTheme: IconThemeData(color: shader1),
|
iconTheme: IconThemeData(color: shader1),
|
||||||
canvasColor: shader6,
|
canvasColor: shader6,
|
||||||
@ -179,7 +180,8 @@ class AppTheme {
|
|||||||
toggleableActiveColor: main1);
|
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 {
|
class ColorUtils {
|
||||||
@ -188,14 +190,18 @@ class ColorUtils {
|
|||||||
return hslc.withLightness((hslc.lightness + amt).clamp(0.0, 1.0)).toColor();
|
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) {
|
static Color blend(Color dst, Color src, double opacity) {
|
||||||
return Color.fromARGB(
|
return Color.fromARGB(
|
||||||
255,
|
255,
|
||||||
(dst.red.toDouble() * (1.0 - opacity) + src.red.toDouble() * opacity).toInt(),
|
(dst.red.toDouble() * (1.0 - opacity) + src.red.toDouble() * opacity)
|
||||||
(dst.green.toDouble() * (1.0 - opacity) + src.green.toDouble() * opacity).toInt(),
|
.toInt(),
|
||||||
(dst.blue.toDouble() * (1.0 - opacity) + src.blue.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(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user