Overview
Returns the complete Dynamic Color system colors following Material Design 3 guidelines. Provides separate color sets for light and dark themes, plus the active theme colors.Method Signature
Parameters
Callback function that receives the colors objectCallback Parameters:
colors(object): Complete color system with light, dark, dayNight, and theme properties
Returns
Complete Dynamic Color system with the following structure:
Example
Example Response
Common Usage Patterns
Apply Colors to DOM
Apply with Surface Tinting
Use in CSS
After applying colors to DOM, use them in your styles:Implementation Details
- Platform Support: Android 12+ (API level 32)
- Color Format: Hex color strings (e.g.,
#8D4E2A) - Material Design: Follows M3 color system specification
- Source Reference:
plugin.js:209-210,DynamicColor.java:118-223
Always check availability using
isDynamicColorAvailable() before calling this method. On unsupported devices, the returned object will be empty.Related Methods
tintColors()- Apply elevation tints to color setstintSurfaceColors()- Apply tints to surface colors onlycolorsToDom()- Apply colors as CSS variablescolorsToCssVars()- Convert colors to CSS variable string