feat(Core UI): 白天黑夜模式
This commit is contained in:
@@ -41,17 +41,4 @@ class AppColors {
|
|||||||
// ── Neutral black Scale ─────────────────────────────────────────────────────
|
// ── Neutral black Scale ─────────────────────────────────────────────────────
|
||||||
static const black12 = Color(0x1F000000); // 12% opacity
|
static const black12 = Color(0x1F000000); // 12% opacity
|
||||||
static const black60 = Color(0x99000000); // 60% opacity
|
static const black60 = Color(0x99000000); // 60% opacity
|
||||||
|
|
||||||
/// 阴影颜色 Token
|
|
||||||
static Color shadow(BuildContext context) {
|
|
||||||
final brightness = Theme
|
|
||||||
.of(context)
|
|
||||||
.brightness;
|
|
||||||
|
|
||||||
if (brightness == Brightness.dark) {
|
|
||||||
return black60;
|
|
||||||
}
|
|
||||||
|
|
||||||
return black12;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class AppShadows {
|
|||||||
BoxShadow(
|
BoxShadow(
|
||||||
|
|
||||||
/// 阴影颜色来自 Design Token
|
/// 阴影颜色来自 Design Token
|
||||||
color: AppColors.shadow(context),
|
color: _shadowColor,
|
||||||
|
|
||||||
/// 模糊半径(影响阴影扩散范围)
|
/// 模糊半径(影响阴影扩散范围)
|
||||||
blurRadius: blur,
|
blurRadius: blur,
|
||||||
@@ -115,4 +115,15 @@ class AppShadows {
|
|||||||
blur: 16,
|
blur: 16,
|
||||||
dy: 8,
|
dy: 8,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/// 阴影颜色 Token
|
||||||
|
Color get _shadowColor {
|
||||||
|
final brightness = Theme
|
||||||
|
.of(context)
|
||||||
|
.brightness;
|
||||||
|
|
||||||
|
return brightness == Brightness.dark
|
||||||
|
? AppColors.black60
|
||||||
|
: AppColors.black12;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user