Overview
Mixes two colors together according to Material Design Guidelines Elevation levels. This method applies predefined tint amounts based on elevation levels 1-5, following Material Design specifications for surface elevation tinting.Signature
Parameters
The base color as a hex string (e.g.,
'#FFFBFF'). Typically a surface color.The tint color as a hex string (e.g.,
'#8D4E2A'). Typically the surfaceTint color.The elevation level from
1 to 5. Each level corresponds to a predefined tint amount:1→ 5% tint (0.05)2→ 8% tint (0.08)3→ 11% tint (0.11)4→ 12% tint (0.12)5→ 14% tint (0.14)
Returns
A hex color string representing the mixed color at the specified elevation level.
Elevation Tint Map
The elevation-to-tint mapping is defined in Material Design Guidelines:| Elevation | Tint Amount | Use Case |
|---|---|---|
| 1 | 5% | Low elevation surfaces |
| 2 | 8% | Cards, elevated buttons |
| 3 | 11% | Menus, dialogs |
| 4 | 12% | Navigation drawer |
| 5 | 14% | Modal bottom sheets |
Example
Use Cases
Creating Elevated Surfaces
Custom Component Elevation
This method is internally used by
tintColors to generate surface1-surface5 variants automatically.Implementation Details
Implementation location:www/plugin.js:63-66
The elevation map is defined at www/plugin.js:31-37:
Material Design Guidelines
This implementation follows the Material Design 3 elevation tinting system, which applies surface tint to create visual hierarchy and depth without using shadows.Related Methods
mixColor- Mix colors with custom amount valuestintColors- Apply elevation tints to multiple colorstintSurfaceColors- Convenience method for surface colors