33import android .graphics .*;
44import android .view .View ;
55import com .tool .tree .ThemeModeState ;
6+ import androidx .core .content .ContextCompat ;
7+ import com .tool .tree .R ;
68
79public final class BlurEngine {
810 public static BlurController controller = new BlurController ();
@@ -89,9 +91,9 @@ public Bitmap getUpdatedBlurBitmap() {
8991 private int getBlurTintColor () {
9092 // Tối ưu màu sắc cho SDK 23+ (Dark mode hệ thống chưa có nên dựa vào ThemeModeState là chuẩn)
9193 if (ThemeModeState .isDarkMode ()) {
92- return Color . parseColor ( "#88000000" ); // Đậm hơn một chút cho sang
94+ return ContextCompat . getColor ( targetView . getContext (), R . color . colorBlurDark ); // Đậm hơn một chút cho sang
9395 } else {
94- return Color . parseColor ( "#c0FFFFFF" ); // Trắng mờ nhẹ
96+ return ContextCompat . getColor ( targetView . getContext (), R . color . colorBlurLight ); // Trắng mờ nhẹ
9597 }
9698 }
9799
@@ -104,9 +106,9 @@ public static Paint getStrokePaint() {
104106
105107 // Cập nhật màu viền theo Theme hiện tại
106108 if (ThemeModeState .isDarkMode ()) {
107- strokePaint .setColor (Color . parseColor ( "#80888888" ));
109+ strokePaint .setColor (ContextCompat . getColor ( targetView . getContext (), R . color . colorPirmLight ));
108110 } else {
109- strokePaint .setColor (Color . parseColor ( "#80888888" ));
111+ strokePaint .setColor (ContextCompat . getColor ( targetView . getContext (), R . color . colorPirmDark ));
110112 }
111113 return strokePaint ;
112114 }
0 commit comments