Usage
Theme Components
The theme system consists of three main components:- Colors - Color palette for light and dark themes
- Typography - Text styles and font definitions
- Theme - The wrapper that provides theming context
Colors
Access theme colors throughAppTheme.colors:
Color Palette
Semantic Color Function
Automatically get the appropriate content color:Typography
Access typography styles throughAppTheme.typography:
Typography Scale
Custom Typography
Dark Theme
Lumo UI automatically supports dark mode:Manual Dark Mode Control
Detecting Current Theme
Local Providers
The theme provides several composition locals:Theme Utilities
Text Selection Colors
Text selection colors are automatically configured:Ripple Effects
Interactive elements use themed ripple effects:Customizing the Theme
Custom Colors
To customize colors, modify the color scheme:Custom Typography
Define custom typography:Best Practices
- Use Theme Colors: Always use
AppTheme.colorsinstead of hardcoded colors - Typography Styles: Use predefined typography styles for consistency
- Content Color: Use
contentColorFor()for automatic color pairing - Dark Mode: Test both light and dark themes
- Local Colors: Use
LocalContentColorfor adaptive text colors - Surface Colors: Use surface colors for cards and elevated components
- Semantic Colors: Use error colors for error states, not arbitrary red
Composition Locals
The theme sets up these composition locals:Common Patterns
Adaptive Components
Themed Icons
Status Colors
Source Reference
See the full implementation inTheme.kt:14-43.