All Projects โ†’ mrousavy โ†’ Colorwaver

mrousavy / Colorwaver

Licence: other
๐ŸŽจ An app to detect color palettes in the real world - powered by VisionCamera

Programming Languages

typescript
32286 projects
kotlin
9241 projects
java
68154 projects - #9 most used programming language
objective c
16641 projects - #2 most used programming language
swift
15916 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Colorwaver

pantone-colors
Hex values of all 2310 Pantone colors
Stars: โœญ 147 (-59.73%)
Mutual labels:  color, palette, colors
Colorpicker
jQuery UI widget for color picking (similar to the one in Microsoft Office 2010).
Stars: โœญ 271 (-25.75%)
Mutual labels:  color, palette, colors
Color.js
Extract colors from an image (0.75 KB) ๐ŸŽจ
Stars: โœญ 42 (-88.49%)
Mutual labels:  color, palette, colors
anypalette.js
๐ŸŽจ Read/write all color palette file formats โค๐Ÿงก๐Ÿ’›๐Ÿ’š๐Ÿ’™๐Ÿ’œ
Stars: โœญ 41 (-88.77%)
Mutual labels:  color, palette, colors
Color Names
Large list of handpicked color names ๐ŸŒˆ
Stars: โœญ 1,198 (+228.22%)
Mutual labels:  color, palette, colors
colorgrab
A cross-platform color picker
Stars: โœญ 80 (-78.08%)
Mutual labels:  palette, colors
log-utils
Basic logging utils: colors, symbols and timestamp.
Stars: โœญ 24 (-93.42%)
Mutual labels:  color, colors
color-math
Expressions to manipulate colors.
Stars: โœญ 18 (-95.07%)
Mutual labels:  color, colors
concolor
Colouring template strings using tags with annotations ๐ŸŽจ
Stars: โœญ 35 (-90.41%)
Mutual labels:  color, colors
ColorBlender
A .NET library for color matching and palette design.
Stars: โœญ 27 (-92.6%)
Mutual labels:  color, palette
console-logging
Better, prettier commandline logging for Python--with colors! ๐Ÿ‘ป
Stars: โœญ 111 (-69.59%)
Mutual labels:  color, colors
leeks.js
Simple ANSI styling for your terminal
Stars: โœญ 12 (-96.71%)
Mutual labels:  color, colors
multi-brand-colors
Multi Brand Colors with support for CSS/CSS-Vars/SCSS/SASS/Stylus/LESS/JSON
Stars: โœญ 26 (-92.88%)
Mutual labels:  color, colors
hcv-color
๐ŸŒˆ Color model HCV/HCG is an alternative to HSV and HSL, derived by Munsell color system, usable for Dark and Light themes... ๐ŸŒˆ
Stars: โœญ 44 (-87.95%)
Mutual labels:  color, palette
javascript-color-gradient
Lightweight JavaScript library, used to generate an array of color gradients, between start and finish colors.
Stars: โœญ 54 (-85.21%)
Mutual labels:  color, palette
SwiftColorWheel
Delightful color picker wheel for iOS in Swift.
Stars: โœญ 37 (-89.86%)
Mutual labels:  color, colors
color
OCaml library to work with colors on the web
Stars: โœญ 20 (-94.52%)
Mutual labels:  color, colors
line
An easy to use golang package for stylizing terminal output
Stars: โœญ 26 (-92.88%)
Mutual labels:  color, colors
colortest
Quickly show all your terminal colors
Stars: โœญ 66 (-81.92%)
Mutual labels:  color, colors
Giotto
Theme manager for your app: apply styles to anything you want through a plist file
Stars: โœญ 18 (-95.07%)
Mutual labels:  color, colors

Colorwaver

An app to detect colorwaves (swatches/palettes) in the real world - powered by VisionCamera and Reanimated.

I wrote this app in less than a day, a speed simply not matched by native app development. Because it's written in React Native (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.

See this Tweet for more information.

Buy Me a Coffee at ko-fi.com

Try it!

Download the repository and run the following commands to try Colorwaver for yourself:

iOS

yarn try-ios

Android

yarn try-android

Project structure

This is a bare React Native project, created with create-react-native-app.


  • ๐Ÿ“ src: Contains the actual TypeScript + React (-Native) front-end for the Colorwaver App.
    • ๐Ÿ“„ 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')

    • ๐Ÿ“„ 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.

    • ๐Ÿ“„ src/Splash.tsx: The first Splash page to ask the user for Camera permission.

    • ๐Ÿ“„ src/App.tsx: Contains the actual source code for the App's front-end.

      • VisionCamera is used to get a Camera device and display a Camera component. Also, a frame processor (a function that gets called for every frame the camera "sees") gets attached, which calls the native iOS/Android frame processor plugin.
      • Reanimated is used to smoothly animate between color changes.

      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. The frame processing runs on a separate Thread from VisionCamera, which then dispatches the animations on the Reanimated UI Thread. This is why the App runs as smooth as a native iOS or Android app.

    • ๐Ÿ“„ src/useAnimatedColor.ts: A helper function to animate color changes with SharedValues.


  • ๐Ÿ“ ios: Contains the basic skeleton for a React Native iOS app, plus the native getColorPalette(...) Frame Processor Plugin.
    • ๐Ÿ“„ ios/PaletteFrameProcessorPlugin.m: Declares the Swift frame processor plugin "getColorPalette(...)".

    • ๐Ÿ“„ ios/PaletteFrameProcessorPlugin.swift: Contains the actual Swift code for the native iOS frame processor plugin "getColorPalette(...)".

      This uses the CoreImage API to convert the CMSampleBuffer to a UIImage, and then uses the UIImageColors library to build the color palette.

      VisionCamera's frame processor API is used to expose this function as a frame processor plugin.

    • ๐Ÿ“„ ios/Colorwaver-Bridging-Header.h: A Bridging Header to import Objective-C headers into Swift.

    • ๐Ÿ“„ ios/Podfile: Adds the UIImageColors library.

    • ๐Ÿ“„ ios/UIColor+hexString.swift: An extension for UIColor to convert UIColor instances to strings. This is required because React Native handles colors as strings.


  • ๐Ÿ“ android: Contains the basic skeleton for a React Native Android app, plus the native getColorPalette(...) Frame Processor Plugin.
    • ๐Ÿ“„ android/app/build.gradle: The gradle build file for the Android project. The following third-party dependencies are installed:

      • androidx.camera: camera-core
      • androidx.palette: palette
    • ๐Ÿ“ android/app/src/main/java/com/colorwaver/utils: Contains two files copied from android/camera-samples to convert ImageProxy instances to Bitmaps. (YuvToRgbConverter.kt)

    • ๐Ÿ“ android/app/src/main/java/com/colorwaver: Contains the actual Java source code of the Project.

    • ๐Ÿ“„ android/app/src/main/java/com/colorwaver/MainApplication.java: Sets up react-native-reanimated.

    • ๐Ÿ“„ android/app/src/main/java/com/colorwaver/MainActivity.java: Installs the PaletteFrameProcessorPlugin frame processor plugin inside of the onCreate method.

    • ๐Ÿ“„ android/app/src/main/java/com/colorwaver/PaletteFrameProcessorPlugin.java: Contains the actual Java code for the native Android frame processor plugin "getColorPalette(...)".

      This uses the YuvToRgbConverter to convert the ImageProxy to a Bitmap, and then passes that to the Palette API from AndroidX to build the color palette.

      VisionCamera's frame processor API is used to expose this function as a frame processor plugin.


  • ๐Ÿ“„ babel.config.js: Adds the native frame processor plugin getColorPalette (called __getColorPalette) to Reanimated's global list.

Credits

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].