Loading packages/SystemUI/monet/src/com/android/systemui/monet/ColorScheme.kt +1 −1 Original line number Diff line number Diff line Loading @@ -435,7 +435,7 @@ class ColorScheme( val h = "H${hct.hue.roundToInt().toString().padEnd(width)}" val c = "C${hct.chroma.roundToInt().toString().padEnd(width)}" val t = "T${CamUtils.lstarFromInt(color).roundToInt().toString().padEnd(width)}" val hex = Integer.toHexString(color).replaceRange(0, 2, "").uppercase() val hex = Integer.toHexString(color and 0xffffff).padStart(6, '0').uppercase() return "$h$c$t = #$hex" } Loading packages/SystemUI/tests/src/com/android/systemui/monet/ColorSchemeTest.java +14 −0 Original line number Diff line number Diff line Loading @@ -146,6 +146,20 @@ public class ColorSchemeTest extends SysuiTestCase { Assert.assertTrue(cam.getChroma() <= 8.0); } @Test @SuppressWarnings("ResultOfMethodCallIgnored") public void testToString() { new ColorScheme(Color.TRANSPARENT, false /* darkTheme */).toString(); new ColorScheme(Color.argb(0, 0, 0, 0xf), false /* darkTheme */).toString(); new ColorScheme(Color.argb(0xff, 0xff, 0, 0), false /* darkTheme */).toString(); new ColorScheme(0xFFFFFFFF, false /* darkTheme */).toString(); new ColorScheme(Color.TRANSPARENT, true /* darkTheme */).toString(); new ColorScheme(Color.argb(0, 0, 0, 0xf), true /* darkTheme */).toString(); new ColorScheme(0xFFFF0000, true /* darkTheme */).toString(); new ColorScheme(0xFFFFFFFF, true /* darkTheme */).toString(); } /** * Generate xml for SystemPaletteTest#testThemeStyles(). */ Loading Loading
packages/SystemUI/monet/src/com/android/systemui/monet/ColorScheme.kt +1 −1 Original line number Diff line number Diff line Loading @@ -435,7 +435,7 @@ class ColorScheme( val h = "H${hct.hue.roundToInt().toString().padEnd(width)}" val c = "C${hct.chroma.roundToInt().toString().padEnd(width)}" val t = "T${CamUtils.lstarFromInt(color).roundToInt().toString().padEnd(width)}" val hex = Integer.toHexString(color).replaceRange(0, 2, "").uppercase() val hex = Integer.toHexString(color and 0xffffff).padStart(6, '0').uppercase() return "$h$c$t = #$hex" } Loading
packages/SystemUI/tests/src/com/android/systemui/monet/ColorSchemeTest.java +14 −0 Original line number Diff line number Diff line Loading @@ -146,6 +146,20 @@ public class ColorSchemeTest extends SysuiTestCase { Assert.assertTrue(cam.getChroma() <= 8.0); } @Test @SuppressWarnings("ResultOfMethodCallIgnored") public void testToString() { new ColorScheme(Color.TRANSPARENT, false /* darkTheme */).toString(); new ColorScheme(Color.argb(0, 0, 0, 0xf), false /* darkTheme */).toString(); new ColorScheme(Color.argb(0xff, 0xff, 0, 0), false /* darkTheme */).toString(); new ColorScheme(0xFFFFFFFF, false /* darkTheme */).toString(); new ColorScheme(Color.TRANSPARENT, true /* darkTheme */).toString(); new ColorScheme(Color.argb(0, 0, 0, 0xf), true /* darkTheme */).toString(); new ColorScheme(0xFFFF0000, true /* darkTheme */).toString(); new ColorScheme(0xFFFFFFFF, true /* darkTheme */).toString(); } /** * Generate xml for SystemPaletteTest#testThemeStyles(). */ Loading