Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0835ba02 authored by James O'Leary's avatar James O'Leary Committed by Automerger Merge Worker
Browse files

Merge changes from topic "variants_landing" into tm-dev am: ee74679e am: e902b8db

parents e245b92c e902b8db
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -225,8 +225,13 @@ class ColorScheme(
    constructor(@ColorInt seed: Int, darkTheme: Boolean):
            this(seed, darkTheme, Style.TONAL_SPOT)

    constructor(wallpaperColors: WallpaperColors, darkTheme: Boolean):
            this(getSeedColor(wallpaperColors), darkTheme)
    @JvmOverloads
    constructor(
        wallpaperColors: WallpaperColors,
        darkTheme: Boolean,
        style: Style = Style.TONAL_SPOT
    ):
            this(getSeedColor(wallpaperColors), darkTheme, style)

    val allAccentColors: List<Int>
        get() {
+10 −0
Original line number Diff line number Diff line
@@ -62,6 +62,16 @@ public class ColorSchemeTest extends SysuiTestCase {
        Assert.assertEquals(rankedSeedColors, List.of(0xffaec00a));
    }

    @Test
    public void testStyleApplied() {
        WallpaperColors wallpaperColors = new WallpaperColors(Color.valueOf(0xffaec00a),
                null, null);
        // Expressive applies hue rotations to the theme color. The input theme color has hue
        // 117, ensuring the hue changed significantly is a strong signal styles are being applied.
        ColorScheme colorScheme = new ColorScheme(wallpaperColors, false, Style.EXPRESSIVE);
        Assert.assertEquals(Cam.fromInt(colorScheme.getAccent1().get(6)).getHue(), 357.46, 0.1);
    }


    @Test
    public void testFiltersInvalidColors() {