[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-7524":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":16,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":18,"archived":19,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":27,"readmeContent":28,"aiSummary":29,"trendingCount":16,"starSnapshotCount":16,"syncStatus":30,"lastSyncTime":31,"discoverSource":32},7524,"Colorful","garretyoder\u002FColorful","garretyoder","Android runtime theme library","",null,"Kotlin",2115,195,1,8,0,58.88,"Apache License 2.0",true,false,"master",[23,24,25,26],"android","runtime","theme","themes","2026-06-12 04:00:34","# Discontinued\nAndroid has had native theming for awhile now, so Colorful's purpose has been served and the library has been discontinued.\n\n\u003Cimg src=\"screenshots\u002FColorful.png\" width=\"200\">\n\n# Colorful\n[![Release](https:\u002F\u002Fjitpack.io\u002Fv\u002Fgarretyoder\u002FColorful.svg)](https:\u002F\u002Fjitpack.io\u002F#garretyoder\u002FColorful) [![Build Status](https:\u002F\u002Ftravis-ci.org\u002Fgarretyoder\u002FColorful.svg?branch=master)](https:\u002F\u002Ftravis-ci.org\u002Fgarretyoder\u002FColorful)\n\n\nColorful is a dynamic theme library allowing you to change your apps' color schemes easily.\n\n*Colorful v2 is here! v2 has been rewritten from the ground up in Kotlin to be lighter, faster, and more feature-packed*\n\n## License\n\nColorful is licensed under the Apache 2.0 License\n\nCopyright 2018 Garret Yoder\n\n|                                    |                                    |                                    |\n| ---------------------------------- | ---------------------------------- | ---------------------------------- |\n| ![Image](screenshots\u002Fscreen1.png)  | ![Image](screenshots\u002Fscreen2.png)  | ![Image](screenshots\u002Fscreen3.png)  |\n\n## Installation\nAdd jitpack to your maven sources\n```groovy\nallprojects {\n    repositories {\n        ...\n        maven { url \"https:\u002F\u002Fjitpack.io\" }\n    }\n}\n```\nAdd Colorful as a dependency to your `build.gradle`\n```groovy\ndependencies {\n    implementation 'com.github.garretyoder:Colorful:2.3.4'\n}\n```\n\n## Usage\n\n### Initialization\n\nIn your `Application` class, you must initialize Colorful and set the default theme colors.\n```kotlin\nclass SampleApp:Application() {\n    override fun onCreate() {\n        super.onCreate()\n        val defaults:Defaults = Defaults(\n                primaryColor = ThemeColor.GREEN,\n                accentColor = ThemeColor.BLUE,\n                useDarkTheme = false,\n                translucent = false)\n        initColorful(this, defaults)\n    }\n}\n```\nThe following is a list of all theme colors available. \n```kotlin\nThemeColor.RED\nThemeColor.PINK\nThemeColor.PURPLE\nThemeColor.DEEP_PURPLE\nThemeColor.INDIGO\nThemeColor.BLUE\nThemeColor.LIGHT_BLUE\nThemeColor.CYAN\nThemeColor.TEAL\nThemeColor.GREEN\nThemeColor.LIGHT_GREEN\nThemeColor.LIME\nThemeColor.YELLOW\nThemeColor.AMBER\nThemeColor.ORANGE\nThemeColor.DEEP_ORANGE\nThemeColor.BROWN\nThemeColor.GREY\nThemeColor.BLUE_GREY\nThemeColor.WHITE\nThemeColor.BLACK\n```\n\n### Using Themes\n\nAny `Activity` you wish to be automatically themed must inherit from either `CActivity`, `CAppCompatActivity` if you wish to use AppCompat or `CMaterialActivity` if you wish to use the new Material Componets theme. *Note* The material componets theme is still beta and is available only in the testing android-p branch. To use the material-componets theme, please add the android-p colorful branch to your gradle build.\n```kotlin\nclass MainActivity : CActivity()\n```\n```kotlin\nclass MainActivity : CAppCompatActivity()\n```\n*Only available in the android-p branch*\n```kotlin\nclass MainActivity : CMaterialActivity()\n```\nIf you wish to use your own activity, you can manually apply Colorful's theme to any activity using `apply(activity:Activity)`\n```kotlin\nColorful().apply(this, override = true, baseTheme = BaseTheme.THEME_MATERIAL)\n```\nThe `override` value will control whether Colorful overrides your activitie's existing base theme, or merely sets primary and accent colors. **Note**: dark\u002Flight themeing will not work when override is disabled\nThe `baseTheme` value will control which base theme Colorful will use, Appcompat, Material, or Material Componets.\n\nAlternatively, as of Colorful 2.1, you can now have your activity inherit from the interface `CThemeInterface` which will provide the `handleOnCreate` and `handleOnResume` methods for automatic theme handling.\nSee both [CActivity](https:\u002F\u002Fgithub.com\u002Fgarretyoder\u002FColorful\u002Fblob\u002Fmaster\u002Flibrary\u002Fsrc\u002Fmain\u002Fjava\u002Fio\u002Fmultimoon\u002Fcolorful\u002FCActivity.kt) and [CAppCompatActivity](https:\u002F\u002Fgithub.com\u002Fgarretyoder\u002FColorful\u002Fblob\u002Fmaster\u002Flibrary\u002Fsrc\u002Fmain\u002Fjava\u002Fio\u002Fmultimoon\u002Fcolorful\u002FCAppCompatActivity.kt) for examples on how to implement the `CThemeInterface`\n\n### Setting The Theme\n\nYou can set the colors at any time using the `edit()` method\n```kotlin\nColorful().edit()\n        .setPrimaryColor(ThemeColor.RED)\n        .setAccentColor(ThemeColor.BLUE)\n        .setDarkTheme(true)\n        .setTranslucent(true)\n        .apply(context:Context)\n```\nYou must call `apply(context:Context)` to save your changes\n\n`primaryColor` the primary color of your theme. This affects componets such as toolbars, task descriptions, etc\n`accentColor` the accent color of your theme. This affects componets such as buttons, sliders, checkboxes, etc\n`darkTheme` the base theme of your style. This controls whether the theme is dark or light.\n`translucent` This controls whether translucency is enabled. This will turn the status bar translucent or solid\n\nColorful will handle saving and loading your theme preferences for you.\n\nThe `apply` method optionally takes a high-order function as a argument. This serves as a callback that will be triggered once Colorful has finished it's theme changes. A example usage would be to recreate the current activity after setting a new theme to immediately reflect changes.\n```kotlin\nColorful().edit()\n    .setPrimaryColor(ThemeColor.PURPLE)\n    .setAccentColor(ThemeColor.GREEN)\n    .apply(this) { \n        this.recreate() \n    }\n```\n\n### Getting the current theme values\n\nColorful can provide you with hex string, or android rgb int formatted values for the currently set colors. This is acheived through the `ColorPack` class, which is a pack that contains both dark and normal variants of the color. These are based off the Material Color Pallet 500 (normal) and 700 (dark) values. Examples are shown below.\n```kotlin\nColorful().getPrimaryColor().getColorPack().dark().asInt()\nColorful().getAccentColor().getColorPack().normal().asHex()\n```\n`Colorful().getDarkTheme()` will return a `boolean` value for whether the dark theme is enabled\n\n`Colorful().getTranslucent()` will return a `boolean` value for whether the current style has transluceny enabled.\n\n\n### Custom styles\n\nColorful has beta support for combining your own styles with it's own. This is not yet guaranteed to work reliably. \n```kotlin\nColorful().edit()\n                .setPrimaryColor(ThemeColor.RED)\n                .setAccentColor(ThemeColor.BLUE)\n                .setDarkTheme(true)\n                .setTranslucent(true)\n                .setCustomThemeOverride(R.style.AppTheme)\n                .apply(this)\n ```\n The `setCustomThemeOverride` method will allow Colorful to mix a provided theme with it's own. If you wish to set specific theme items yourself, such as coloring all text orange, you can do this within a style file and then have Colorful merge it with it's own theme.\n\n### Custom theme colors\n\nColorful allows you to define custom themes (e.g. light red primary color with dark yellow accents). If you want to use custom styles you have to do following 3 things:\n\n1. create styles for your custom themes:\n\n```kotlin\n\u003Cstyle name=\"my_custom_primary_color\">\n\t\u003Citem name=\"android:colorPrimary\">@color\u002Fmd_red_200\u003C\u002Fitem>\n\t\u003Citem name=\"colorPrimary\">@color\u002Fmd_red_200\u003C\u002Fitem>\n\u003C\u002Fstyle>\n\u003Cstyle name=\"my_custom_primary_dark_color\">\n\t\u003Citem name=\"android:colorPrimaryDark\">@color\u002Fmd_red_400\u003C\u002Fitem>\n\t\u003Citem name=\"colorPrimaryDark\">@color\u002Fmd_red_400\u003C\u002Fitem>\n\u003C\u002Fstyle>\n\u003Cstyle name=\"my_custom_accent_color\">\n\t\u003Citem name=\"android:colorAccent\">@color\u002Fmd_yellow_700\u003C\u002Fitem>\n\t\u003Citem name=\"colorAccent\">@color\u002Fmd_yellow_700\u003C\u002Fitem>\n\u003C\u002Fstyle>\n```\n \n 2. Create a custom theme color object, like following:\n \n```kotlin\nvar myCustomColor1 = CustomThemeColor(\n\tcontext,\n\tR.style.my_custom_primary_color,\n\tR.style.my_custom_primary_dark_color,\n\tR.color.md_red_200, \u002F\u002F \u003C= use the color you defined in my_custom_primary_color\n\tR.color.md_red_400 \u002F\u002F \u003C= use the color you defined in my_custom_primary_dark_color\n)\n\u002F\u002F used as accent color, dark color is irrelevant...\nvar myCustomColor2 = CustomThemeColor(\n\tcontext,\n\tR.style.my_custom_accent_color,\n\tR.style.my_custom_accent_color,\n\tR.color.md_yellow_700, \u002F\u002F \u003C= use the color you defined in my_custom_accent_color\n\tR.color.md_yellow_700 \u002F\u002F \u003C= use the color you defined in my_custom_accent_color\n)\n```\n  \n3. use this custom theme color object like you would use any `ThemeColor.\u003CCOLOR>` enum object, e.g.\n \n```kotlin\nvar defaults = Defaults(\n\tprimaryColor = myCustomColor1,\n\taccentColor = myCustomColor2,\n\tuseDarkTheme = true,\n\ttranslucent = false,\n\tcustomTheme = 0\n)\n```\n","Colorful 是一个用于 Android 应用的运行时主题库，允许开发者轻松更改应用的颜色方案。它使用 Kotlin 语言重写，具有轻量、快速和功能丰富的特点。通过 Colorful，开发者可以定义默认的主题颜色，并在应用运行时动态调整这些颜色设置。此外，该库提供了多种预设颜色供选择，支持继承自特定基类的 Activity 自动应用主题样式，包括 Material Components 主题（仅限测试版）。尽管该项目已停止维护，但其设计理念和技术实现仍适用于需要灵活主题切换的 Android 应用开发场景中。",2,"2026-06-11 03:12:52","top_language"]