{"id":18332080,"url":"https://github.com/mrousavy/colorwaver","last_synced_at":"2025-10-08T10:42:49.716Z","repository":{"id":38446442,"uuid":"400730201","full_name":"mrousavy/Colorwaver","owner":"mrousavy","description":"🎨 An app to detect color palettes in the real world - powered by VisionCamera","archived":false,"fork":false,"pushed_at":"2025-07-08T14:42:36.000Z","size":24932,"stargazers_count":660,"open_issues_count":7,"forks_count":82,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-07-08T15:45:14.634Z","etag":null,"topics":["android","app","camera","color","colors","hacktoberfest","ios","palette","react","react-native","visioncamera"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrousavy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":["mrousavy"],"patreon":null,"open_collective":null,"ko_fi":"mrousavy","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2021-08-28T07:24:38.000Z","updated_at":"2025-07-08T14:42:41.000Z","dependencies_parsed_at":"2024-01-22T01:16:43.016Z","dependency_job_id":"f1f6dc05-7aeb-4557-a396-e70a1dabb52e","html_url":"https://github.com/mrousavy/Colorwaver","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mrousavy/Colorwaver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrousavy%2FColorwaver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrousavy%2FColorwaver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrousavy%2FColorwaver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrousavy%2FColorwaver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrousavy","download_url":"https://codeload.github.com/mrousavy/Colorwaver/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrousavy%2FColorwaver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278931652,"owners_count":26070788,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","app","camera","color","colors","hacktoberfest","ios","palette","react","react-native","visioncamera"],"created_at":"2024-11-05T19:37:16.832Z","updated_at":"2025-10-08T10:42:44.680Z","avatar_url":"https://github.com/mrousavy.png","language":"TypeScript","funding_links":["https://github.com/sponsors/mrousavy","https://ko-fi.com/mrousavy","https://ko-fi.com/F1F8CLXG'"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003e\u003cimg align=\"center\" src=\"./ios/Colorwaver/Images.xcassets/AppIcon.appiconset/50.png\" /\u003e Colorwaver\u003c/h1\u003e\n\n  \u003ca align=\"center\" href=\"https://play.google.com/store/apps/details?id=com.mrousavy.colorwaver\"\u003e\u003cimg align=\"center\" src=\"./img/store_badge_android.png\" height=\"50\" /\u003e\u003c/a\u003e\n  \u003ca align=\"center\" href=\"https://apps.apple.com/at/app/colorwaver/id1583400396\"\u003e\u003cimg align=\"center\" src=\"./img/store_badge_apple.png\" height=\"52\" /\u003e\u003c/a\u003e\n\u003c/div\u003e\n\nAn app to detect **colorwaves** (swatches/palettes) in the real world - powered by [VisionCamera](https://github.com/mrousavy/react-native-vision-camera) and [Reanimated](https://github.com/software-mansion/react-native-reanimated).\n\nI wrote this app in less than a day, a speed simply not matched by native app development. Because it's written in [React Native](https://reactnative.dev) (TypeScript/JavaScript), it runs both on iOS and Android, but performance critical parts (e.g. the image processing algorithm or the animations) are backed by native Objective-C/Swift/Java code.\n\nSee [this Tweet](https://twitter.com/mrousavy/status/1431619738673860611) for more information.\n\n\u003ca href='https://ko-fi.com/F1F8CLXG' target='_blank'\u003e\u003cimg height='36' style='border:0px;height:36px;' src='https://az743702.vo.msecnd.net/cdn/kofi2.png?v=0' border='0' alt='Buy Me a Coffee at ko-fi.com' /\u003e\u003c/a\u003e\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"33%\"\u003e\n      \u003cimg src=\"./img/demo_1.png\" /\u003e\n    \u003c/td\u003e\n    \u003ctd width=\"33%\"\u003e\n      \u003cimg src=\"./img/demo_2.png\" /\u003e\n    \u003c/td\u003e\n    \u003ctd width=\"33%\"\u003e\n      \u003cimg src=\"./img/demo.gif\" /\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Try it!\n\nDownload the repository and run the following commands to try **Colorwaver** for yourself:\n\n### iOS\n\n```sh\nyarn try-ios\n```\n\n### Android\n\n```sh\nyarn try-android\n```\n\n## Project structure\n\nThis is a bare React Native project, created with [create-react-native-app](https://github.com/expo/create-react-native-app).\n\n---\n\n* 📁 `src`: Contains the actual TypeScript + React (-Native) front-end for the Colorwaver App.\n  * 📄 `src/getColorPalette.ts`: Exposes the native iOS/Android frame processor plugin as a JS function with TypeScript types. This function has to be called from a frame processor. (`'worklet'`)\n  * 📄 `src/Router.tsx`: The main component that gets registered by `index.js`. This acts as a main navigator, navigating either to the Splash Page (Permissions) or the App Page (Main App) depending on whether the user has granted permissions or not.\n  * 📄 `src/Splash.tsx`: The first Splash page to ask the user for Camera permission.\n  * 📄 `src/App.tsx`: Contains the actual source code for the App's front-end.\n\n    * [VisionCamera](https://github.com/mrousavy/react-native-vision-camera) is used to get a Camera device and **display a Camera component**. Also, a [frame processor](https://mrousavy.github.io/react-native-vision-camera/docs/guides/frame-processors) (a function that gets called for every frame the camera \"sees\") gets attached, which **calls the native iOS/Android frame processor plugin**.\n    * [Reanimated](https://github.com/software-mansion/react-native-reanimated) is used to smoothly animate between color changes.\n\n    Because VisionCamera also uses the Worklet API, the entire process between receiving a camera frame and actually displaying the palette's colors **does not use the React-JS Thread at all**.\n    The frame processing runs on a separate Thread from VisionCamera, which then dispatches the animations on the Reanimated UI Thread.\n    This is why the App runs as smooth as a native iOS or Android app.\n\n  * 📄 `src/useAnimatedColor.ts`: A helper function to animate color changes with `SharedValue`s.\n\n---\n\n* 📁 `ios`: Contains the basic skeleton for a React Native iOS app, plus the native `getColorPalette(...)` Frame Processor Plugin.\n  * 📄 `ios/PaletteFrameProcessorPlugin.m`: Declares the Swift frame processor plugin \"`getColorPalette(...)`\".\n  * 📄 `ios/PaletteFrameProcessorPlugin.swift`: Contains the actual Swift code for the native iOS frame processor plugin \"`getColorPalette(...)`\".\n\n    This uses the CoreImage API to convert the `CMSampleBuffer` to a `UIImage`, and then uses the [`UIImageColors`](https://github.com/jathu/UIImageColors) library to build the color palette.\n\n    VisionCamera's [frame processor API](https://mrousavy.github.io/react-native-vision-camera/docs/guides/frame-processors-plugins-overview) is used to expose this function as a frame processor plugin.\n  * 📄 `ios/Colorwaver-Bridging-Header.h`: A Bridging Header to import Objective-C headers into Swift.\n  * 📄 `ios/Podfile`: Adds the [`UIImageColors`](https://github.com/jathu/UIImageColors) library.\n  * 📄 `ios/UIColor+hexString.swift`: An extension for `UIColor` to convert `UIColor` instances to strings. This is required because React Native handles colors as strings.\n\n---\n\n* 📁 `android`: Contains the basic skeleton for a React Native Android app, plus the native `getColorPalette(...)` Frame Processor Plugin.\n  * 📄 `android/app/build.gradle`: The gradle build file for the Android project. The following third-party dependencies are installed:\n    * `androidx.camera`: `camera-core`\n    * `androidx.palette`: `palette`\n  * 📁 `android/app/src/main/java/com/colorwaver/utils`: Contains two files copied from [**android/camera-samples**](https://github.com/android/camera-samples/tree/master/Camera2Basic/utils/src/main/java/com/example/android/camera/utils) to convert `ImageProxy` instances to `Bitmap`s. (`YuvToRgbConverter.kt`)\n  * 📁 `android/app/src/main/java/com/colorwaver`: Contains the actual Java source code of the Project.\n  * 📄 `android/app/src/main/java/com/colorwaver/MainApplication.java`: Sets up react-native-reanimated.\n  * 📄 `android/app/src/main/java/com/colorwaver/MainActivity.java`: Installs the `PaletteFrameProcessorPlugin` frame processor plugin inside of the `onCreate` method.\n  * 📄 `android/app/src/main/java/com/colorwaver/PaletteFrameProcessorPlugin.java`: Contains the actual Java code for the native Android frame processor plugin \"`getColorPalette(...)`\".\n\n    This uses the `YuvToRgbConverter` to convert the `ImageProxy` to a `Bitmap`, and then passes that to the [Palette API from AndroidX](https://developer.android.com/reference/androidx/palette/graphics/Palette) to build the color palette.\n\n    VisionCamera's [frame processor API](https://mrousavy.github.io/react-native-vision-camera/docs/guides/frame-processors-plugins-overview) is used to expose this function as a frame processor plugin.\n\n---\n\n* 📄 `babel.config.js`: Adds the native frame processor plugin `getColorPalette` (called `__getColorPalette`) to Reanimated's `global` list.\n\n\n## Credits\n\n* [**@Simek**](https://github.com/Simek) for the original idea\n* [react-native-reanimated](https://github.com/software-mansion/react-native-reanimated) for allowing JS code to be dispatched to another Runtime (Worklets)\n* [react-native-vision-camera](https://github.com/mrousavy/react-native-vision-camera) for allowing you to run JS code on a realtime feed of Camera Frames (Frame Processors)\n* The [Palette API from AndroidX](https://developer.android.com/reference/androidx/palette/graphics/Palette) for getting the Color Palette on Android\n* [`UIImageColors`](https://github.com/jathu/UIImageColors) for getting the Color Palette on iOS\n* **You guys**, for downloading, giving 5 stars, and pushing Colorwaver up in the Charts.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrousavy%2Fcolorwaver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrousavy%2Fcolorwaver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrousavy%2Fcolorwaver/lists"}