Droidcon Berlin: A ride through AOSP's new colors
At Droidcon Berlin 2022
Dynamic colors on Android are a mystery unsolved! In this talk we go through aspects of Material 3’s color science and color extraction algorithms via Monet, the theme engine on Android.
We examine various parts of the Android framework and understand the operating system and it’s internals. Android’s dynamic theme system builds on custom color models, multi-step image quantization algorithms and much more!
At Droidcon Berlin 2022
About the talk
Title: A ride through AOSP’s new colors
Date: 7th July 2022
Conference: Droidcon Berlin 2022
Location: CityCube, Berlin, Hall 2 (Hamilton)
Abstract
Dynamic theming on the Pixel is an amazing feature, but we as Android engineers always care about how it works under the hood!
In this talk, we will understand “Monet”, the wallpaper-based dynamic theming system.
We will see:
- What is Monet?
- Dynamic behavior of system-wide theming
- Wallpaper color extraction
- K-means and Celebi quantizers
- Color extraction strategy
- Runtime dynamic color updation
- Dynamic themes with M3 components for Jetpack Compose
In this session, we will aim to understand how the Android operating system works to enable dynamic theming (basics fundamentals of Material You). We will deep dive into AOSP to examine parts of the framework that form Monet and ultimately understand how dynamic system colors work.
Join me on the colourful ride!
Slides
Fun fact: The colors used in the slides are built with the M3 theme system with the help of the Material theme builder.
Fonts used: Gilroy, Roboto, Jetbrains Mono
Image attributions: Material.io and Material design blog under creative commons.
Questions
- Can you use dynamic colors in light mode if system is toggeled in dark states?
Yes it’s possible, you can build apps with Material 3 and Compose to specify light or dark color schemes and give the user an option to use light mode strictly, even if the OS is in dark mode. A good practice with accessibility is to let the user choose from auto, dark or light theme in your app preferences.
Droidcon Berlin 2022
- Is there a possible usage of dynamic colors from the OS in Android for cars? For example on dashboard UIs of the car?
It is possible with custom hardware triggering light or dark system modes and the custom colors from a given launcher background wallpaper setting up the dynamic colors on the apps. It’s a possible valid use case to match the ambiance of the car with music that is playing, day / night time drives.
My experience
With the possible new use cases for device-specific hardware and feature sets, there are exciting possibilities ahead of us.
It was amazing to see the growing interest in system development since we stepped into the Android framework, a subject bit different than the usual traditional talks that focus on the application layer. Going ahead, I hope we find more conversations focusing on Android for system development and embedded Android.
We explored the narrative of what went into building the dynamic theme feature of the Android OS. We examined the internals of Material 3 for Jetpack Compose and its usage.
As a speaker, this was my first talk in person on a stage, and it was amazing! Before the presentation, Manuel Vivo spoke about app architecture and faced technical issues. (The remote was not working and the slides kept skipping in the middle of the presentation). I faced the same challenges and it affected the pace of the talk.
Looking at the brighter side, expect more conversations and talks from me, and hope I get the chance to interact with everyone who attended the session again in the future!
Till then, feel free to reach out and share your experience, in case you use the dynamic colors or Material 3 with compose.
References, attributions & acknowledgments
- Internals of how Monet provides dynamic colors to the Android system
- The science of color & design - James O’Leary
- Material 3 color utilities for overview of Monet’s color system
- Android Code Search for easy and fast exploration of AOSP
- Gurupreet Singh from Material design team at Google
- Droidcon for organizing an amazing event!
Video
Watch it on Droidcon.com