{"id":19521823,"url":"https://github.com/smarttoolfactory/compose-color-detector","last_synced_at":"2025-04-26T09:32:02.903Z","repository":{"id":50362094,"uuid":"495059638","full_name":"SmartToolFactory/Compose-Color-Detector","owner":"SmartToolFactory","description":"🚀🌈🔍  Detect colors from image or your screen after taking it's screenshot and get details as name, hex code, RGB, HSL. Written with Jetpack Compose and Material Design 3","archived":false,"fork":false,"pushed_at":"2022-10-11T16:30:05.000Z","size":12461,"stargazers_count":29,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T10:27:13.344Z","etag":null,"topics":["android","color-detection","color-detector","image-color-detection","image-colors","jetpack-compose","material-design3","screen-color-detection"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SmartToolFactory.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-22T12:54:26.000Z","updated_at":"2025-01-04T11:12:23.000Z","dependencies_parsed_at":"2023-01-19T21:07:19.084Z","dependency_job_id":null,"html_url":"https://github.com/SmartToolFactory/Compose-Color-Detector","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartToolFactory%2FCompose-Color-Detector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartToolFactory%2FCompose-Color-Detector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartToolFactory%2FCompose-Color-Detector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartToolFactory%2FCompose-Color-Detector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SmartToolFactory","download_url":"https://codeload.github.com/SmartToolFactory/Compose-Color-Detector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250967142,"owners_count":21515545,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","color-detection","color-detector","image-color-detection","image-colors","jetpack-compose","material-design3","screen-color-detection"],"created_at":"2024-11-11T00:35:10.883Z","updated_at":"2025-04-26T09:31:59.279Z","avatar_url":"https://github.com/SmartToolFactory.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Compose Color Detector\n\n[![](https://jitpack.io/v/SmartToolFactory/Compose-Color-Detector.svg)](https://jitpack.io/#SmartToolFactory/Compose-Color-Detector)\n\nDetect colors with name, hex code, RGB, HSL from image or your screen after taking it's screenshot\nand color Palettes and profiles\nusing [Palette API](https://developer.android.com/training/material/palette-colors)\nand [Compose ImageCropper library](https://github.com/SmartToolFactory/Compose-Image-Cropper)\n\n\u003cbr\u003e\n\n| Screen | Image | \n| ----------|-----------| \n| \u003cimg src=\"./screenshot/screen_detector.gif\"/\u003e| \u003cimg src=\"./screenshot/image_detector.gif\"/\u003e |\n\n## Gradle Setup\n\nTo get a Git project into your build:\n\n* Step 1. Add the JitPack repository to your build file Add it in your root build.gradle at the end\n  of repositories:\n\n```\nallprojects {\n  repositories {\n      ...\n      maven { url 'https://jitpack.io' }\n  }\n}\n```\n\n* Step 2. Add the dependency\n\n```\ndependencies {\n    implementation 'com.github.SmartToolFactory:Compose-Color-Detector:\u003cversion\u003e'\n}\n```\n\n## ScreenColorDetector\n\n`ScreenColorDetector` uses `ImageWithThumbnail`\nfrom [Compose Image library](https://github.com/SmartToolFactory/Compose-Image)\nto display image in bounds and get bounds and show thumbnail on left or right side of the screenshot\nwhen **enabled**\n\n```kotlin\n@Composable\nfun ScreenColorDetector(\n    modifier: Modifier = Modifier,\n    enabled: Boolean = false,\n    thumbnailSize: Dp = 80.dp,\n    @IntRange(from = 100, to = 500) thumbnailZoom: Int = 200,\n    screenRefreshPolicy: ScreenRefreshPolicy = OnEnable,\n    content: @Composable () -\u003e Unit,\n    delayBeforeCapture: Long = 0L,\n    onColorChange: (ColorData) -\u003e Unit\n) \n```\n\n* **enabled** when enabled detect color at user's point of touch\n* **thumbnailSize** size of the thumbnail that displays touch position with zoom\n* **thumbnailZoom** zoom scale between 100% and 500%\n* **screenRefreshPolicy** how to set or refresh screenshot of the screen. By default screenshot is\n  taken when `enabled` flag is set to true after delay specified with `delayBeforeCapture`.\n* If `OnDown` or `OnUp` is selected screenshot is taken when `enabled` is false and when first\n  pointer is down or last pointer is up after delay specified with `delayBeforeCapture`\n* **delayBeforeCapture** how many milliseconds should be waited before taking screenshot of the\n  screen content is screen/Composable is displayed to user to get color from. `ScreenshotBox`\n  gets `Bitmap` from screen when users first down and stores it.\n* **onColorChange** callback to notify that user moved and picked a color\n\n## ImageColorDetector\n\n`ImageColorDetector` detects color and name from Image on user touch\n\n```kotlin\n@Composable\nfun ImageColorDetector(\n    modifier: Modifier = Modifier,\n    imageBitmap: ImageBitmap,\n    contentScale: ContentScale = ContentScale.FillBounds,\n    alignment: Alignment = Alignment.Center,\n    colorNameParser: ColorNameParser = rememberColorParser(),\n    thumbnailSize: Dp = 70.dp,\n    @IntRange(from = 100, to = 500) thumbnailZoom: Int = 200,\n    onColorChange: (ColorData) -\u003e Unit\n)\n```\n\n* **imageBitmap** image is being drawn and colors to be detected\n* **contentScale** how image should be layout inside the Canvas that is drawn\n* **alignment** Optional alignment parameter used to place the ImageBitmap in the\n* given bounds defined by the width and height\n* **thumbnailSize** size of the thumbnail that displays touch position with zoom\n* **thumbnailZoom** zoom scale between 100% and 500%\n* **onColorChange** callback to notify that user moved and picked a color\n\n## ImageColorPalette\n\n```kotlin\n@Composable\nfun ImageColorPalette(\n    modifier: Modifier = Modifier,\n    imageBitmap: ImageBitmap,\n    selectedIndex: Int,\n    colorNameParser: ColorNameParser = rememberColorParser(),\n    maximumColorCount: Int = 16,\n    onColorChange: (ColorData) -\u003e Unit\n)\n```\n\nGenerates color profiles and percentage of each color\nusing [Palette API](https://developer.android.com/training/material/palette-colors)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmarttoolfactory%2Fcompose-color-detector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmarttoolfactory%2Fcompose-color-detector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmarttoolfactory%2Fcompose-color-detector/lists"}