kmp-theming
Skill4 starsChanged 5 months agoMIT-0View on GitHub
Compose MaterialTheme patterns: Color.kt, Typography, darkColorScheme, and TV-specific theming for KMP apps
In this repository26 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- 10ft-uiSkill
- amazon-devices-vega-app-performanceSkill
- amazon-devices-vega-best-practicesSkill
- amazon-devices-vega-setup-sdkSkill
- android-tv-testingSkill
- changelog-static-siteSkill
- creative-tv-uiSkill
- eas-buildSkill
- expo-tv-configSkill
- firetv-leanbackSkill
- kmp-build-commandsSkill
- kmp-compose-tvSkill
- kmp-data-layerSkill
- kmp-navigationSkill
- kmp-template-anatomySkill
- kmp-verify-patternsSkill
- metaSkill
- rn-manifest-wiringSkill
- rn-shared-ui-catalogSkill
- rn-spatial-navigationSkill
- rn-template-anatomySkill
- rn-themingSkill
- vega-sdkSkill
- video-playerSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 115
All major streaming apps (Netflix, Prime Video, Disney+) are dark
- Very specific: line 117
If a brand requires light mode, you would need to add a lightColorScheme() and a mode toggle.
- Distinctive: line 130
Don't rely solely on color change for focus — motion (scale) is more visible at distance
- Very specific: line 151
Using Color(...) literals in composables: Always reference KmptvColors or MaterialTheme.colorScheme.
- Distinctive: line 154
Focus indication by color alone: Add scale or border. Color-blind users and distance viewing both need redundant cues.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
KMP Theming
Theme lives in
androidtv-app/src/main/java/com/kmptv/androidtv/theme/. A brand kit becomes a theme via darkColorScheme() customization plus a parallel KmptvColors object for TV-specific surfaces.
File structure
androidtv-app/src/main/java/com/kmptv/androidtv/theme/
├── Color.kt # KmptvColors object — TV-specific palette outside MaterialTheme
├── Theme.kt # KMPTVTheme composable wrapping darkColorScheme()
└── Type.kt # Typography definitionsTwo-layer color system
The template uses two complementary color approaches:
Layer 1: MaterialTheme darkColorScheme (Material 3)
private val DarkColorScheme = darkColorScheme(
primary = Color(0xFF90CAF9), // CTAs, active states
secondary = Color(0xFF81C784), // Secondary actions
tertiary = Color(0xFFFFB74D), // Accents, highlights
background = Color(0xFF0D0D0D), // App background
surface = Color(0xFF1E1E1E), // Card surfaces
onPrimary = Color(0xFF000000), // Text on primary
onSecondary = Color(0xFF000000),
onTertiary = Color(0xFF000000),
onBackground = Color(0xFFFFFFFF), // Body text
onSurface = Color(0xFFFFFFFF), // Text on cards
)Access via MaterialTheme.colorScheme.primary, etc.
Layer 2: KmptvColors object (TV-specific)
object KmptvColors {
val Background = Color(0xFF0D0D0D) // Near-black, avoids LCD haloing
val SurfaceElevated = Color(0xFF1A1A1A) // Panels above background
val SurfaceFocus = Color(0xFF2A2A2A) // Unfocused controls
val Accent = Color(0xFFE50914) // Seek-bar, progress (brand red)
}Direct reference: KmptvColors.Background. Used where MaterialTheme semantics don't map well to TV patterns (hero gradients, player controls, surface hierarchy).
Applying brand colors
To rebrand the app:
- Edit
Color.kt— changeKmptvColorsvalues to match the brand palette. - Edit
Theme.kt— updatedarkColorScheme()parameters. - Keep them in sync —
KmptvColors.Backgroundshould matchbackgroundin the scheme.
Mapping brand.json to KMP theme
| Brand field | Goes to | Notes |
primary_color | darkColorScheme(primary = ...) | CTAs, active states |
accent_color | KmptvColors.Accent + tertiary | Focus highlights, progress bars |
background_color | Both background and KmptvColors.Background | Must be identical |
font_family | Type.kt font family | Use Google Fonts or system |
Typography
val Typography = Typography(
headlineLarge = TextStyle(
fontWeight = FontWeight.Bold,
fontSize = 48.sp,
lineHeight = 56.sp,
),
titleMedium = TextStyle(
fontWeight = FontWeight.SemiBold,
fontSize = 20.sp,
),
bodyLarge = TextStyle(
fontSize = 24.sp,
lineHeight = 32.sp,
),
bodyMedium = TextStyle(
fontSize = 18.sp,
lineHeight = 24.sp,
),
labelSmall = TextStyle(
fontSize = 12.sp,
),
)TV-specific typography rules
- Body minimum: 18sp, but prefer 24sp for primary content. Anything smaller is unreadable from couch distance.
- Headlines: 48-64sp. The hero banner uses
headlineLarge. - Font weight: Bold for headings, SemiBold for row titles, Regular for body. Avoid Light/Thin — they disappear on TVs.
- Line height: 1.3-1.4x font size. Tight spacing hurts at 10-foot distance.
TV-specific design decisions
Always dark theme
TV apps default dark. The template only defines darkColorScheme() — no light variant. Rationale:
- TVs are viewed in dim rooms
- Bright backgrounds cause eye strain and LCD bloom
- All major streaming apps (Netflix, Prime Video, Disney+) are dark
If a brand requires light mode, you would need to add a lightColorScheme() and a mode toggle. This is rare for TV.
High contrast for focus states
Focus visibility is critical at 10 feet. The template uses:
- White border (2dp) on focused cards via
.border(2.dp, Color.White, shape) - Scale animation (1.0 -> 1.08) on focus
- Shadow elevation (16dp) on focused items
- Surface tonal elevation change (2dp unfocused -> 8dp focused)
When rebranding, ensure:
- Focus border color contrasts >= 4.5:1 against the card background
- Scale + border together make focus obvious from across the room
- Don't rely solely on color change for focus — motion (scale) is more visible at distance
Surface hierarchy
The template uses a 3-level dark surface system:
Background(0xFF0D0D0D) — page backgroundSurfaceElevated(0xFF1A1A1A) — cards, panelsSurfaceFocus(0xFF2A2A2A) — interactive elements at rest
Each level is subtly lighter than the previous. This creates depth without bright colors.
Gradient overlays
The hero banner uses overlays for text legibility:
- Vertical gradient (transparent -> background) from middle to bottom
- Horizontal gradient (background with alpha -> transparent) on the left side
These ensure text is always readable regardless of the background image.
Anti-patterns
- Using Color(...) literals in composables. Always reference
KmptvColorsorMaterialTheme.colorScheme. Scattered hex codes break theming. - Light backgrounds for TV. Causes eye strain, LCD bloom, and looks wrong next to every other app in the launcher.
- Thin/hairline fonts. Invisible from 10 feet. Minimum weight 400.
- Focus indication by color alone. Add scale or border. Color-blind users and distance viewing both need redundant cues.
- Separate color objects per screen. One
KmptvColors, onedarkColorScheme(). Consistency comes from centralization.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

