material-foundation / material-theme-builder

Visualize dynamic color and create a custom Material Theme.
https://material-foundation.github.io/material-theme-builder/
Apache License 2.0
360 stars 27 forks source link

[Feature request] Generate the Kotlin code once the theme has been selected #200

Closed mikegonzalez2k closed 6 months ago

mikegonzalez2k commented 11 months ago

After choosing a theme it would be useful to generate the Kotlin code instead of having to manually copy it to the project.

Solution: The user creates a custom theme, then selects the Android tab and clicks a button to generate the Kotlin code for the light and dark color scheme. The user directly copies that code into the color.kt file of their project.

Perhaps also generate the code for the vals for the Theme.kt file. For example

val LightColorScheme = lightColorScheme( primary = PrimaryLight

margeeta commented 10 months ago

Thank you for the feature request. Would you mind providing a bit more of your process currently? Material Theme Builder already exports color.kt and theme.kt files so code does not need to be copied.