OSDN Git Service

Turn default gradient into solid black
authorLucas Dupin <dupin@google.com>
Mon, 30 Oct 2017 18:09:25 +0000 (11:09 -0700)
committerandroid-build-team Robot <android-build-team-robot@google.com>
Thu, 8 Feb 2018 04:10:58 +0000 (04:10 +0000)
Test: visual
Bug: 66957450
Change-Id: I6a34a35912e4dd4594565f88636ce89689d26f2f
(cherry picked from commit e7476addecb4fec6abd08cfb7aa27c473ce5c1f0)
(cherry picked from commit 12dad0c4fc5fc8f0988dca0fffd2d26f2cb04195)

core/java/com/android/internal/colorextraction/types/Tonal.java

index e6ef10b..71baaf1 100644 (file)
@@ -51,9 +51,11 @@ public class Tonal implements ExtractionType {
 
     private static final boolean DEBUG = true;
 
+    public static final int THRESHOLD_COLOR_LIGHT = 0xffe0e0e0;
     public static final int MAIN_COLOR_LIGHT = 0xffe0e0e0;
     public static final int SECONDARY_COLOR_LIGHT = 0xff9e9e9e;
-    public static final int MAIN_COLOR_DARK = 0xff212121;
+    public static final int THRESHOLD_COLOR_DARK = 0xff212121;
+    public static final int MAIN_COLOR_DARK = 0xff000000;
     public static final int SECONDARY_COLOR_DARK = 0xff000000;
 
     private final TonalPalette mGreyPalette;
@@ -197,12 +199,12 @@ public class Tonal implements ExtractionType {
         // light fallback or darker than our dark fallback.
         ColorUtils.colorToHSL(mainColor, mTmpHSL);
         final float mainLuminosity = mTmpHSL[2];
-        ColorUtils.colorToHSL(MAIN_COLOR_LIGHT, mTmpHSL);
+        ColorUtils.colorToHSL(THRESHOLD_COLOR_LIGHT, mTmpHSL);
         final float lightLuminosity = mTmpHSL[2];
         if (mainLuminosity > lightLuminosity) {
             return false;
         }
-        ColorUtils.colorToHSL(MAIN_COLOR_DARK, mTmpHSL);
+        ColorUtils.colorToHSL(THRESHOLD_COLOR_DARK, mTmpHSL);
         final float darkLuminosity = mTmpHSL[2];
         if (mainLuminosity < darkLuminosity) {
             return false;