├── .tool-versions
├── example
├── .watchmanconfig
├── tsconfig.json
├── babel.config.js
├── android
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── settings.gradle
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradlew.bat
│ └── gradlew
├── index.js
├── .gitignore
├── metro.config.js
├── ios
│ └── Podfile
├── react-native.config.js
├── app.json
├── package.json
└── src
│ └── App.tsx
├── .github
├── CODEOWNERS
├── dependabot.yml
└── workflows
│ └── ci.yml
├── .yarnrc.yml
├── src
├── __tests__
│ └── index.test.tsx
└── index.tsx
├── .gitattributes
├── babel.config.js
├── ios
├── ColorPickerIos-Bridging-Header.h
├── ColorPickerIos.m
├── ColorPicker.swift
└── ColorPickerIos.xcodeproj
│ └── project.pbxproj
├── android
├── gradle.properties
├── src
│ └── main
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── com
│ │ └── reactnativecolorpickerios
│ │ ├── ColorPickerIosModule.kt
│ │ └── ColorPickerIosPackage.kt
├── .settings
│ └── org.eclipse.buildship.core.prefs
├── .project
└── build.gradle
├── .editorconfig
├── biome.json
├── react-native-color-picker-ios.podspec
├── tsconfig.json
├── .gitignore
├── LICENSE
├── package.json
├── README.md
└── CONTRIBUTING.md
/.tool-versions:
--------------------------------------------------------------------------------
1 | nodejs 22.13.1
2 |
--------------------------------------------------------------------------------
/example/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {}
2 |
--------------------------------------------------------------------------------
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | * @Naturalclar
2 |
--------------------------------------------------------------------------------
/.yarnrc.yml:
--------------------------------------------------------------------------------
1 | nodeLinker: node-modules
2 |
--------------------------------------------------------------------------------
/src/__tests__/index.test.tsx:
--------------------------------------------------------------------------------
1 | it.todo("write a test");
2 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.pbxproj -text
2 | # specific for windows script files
3 | *.bat text eol=crlf
--------------------------------------------------------------------------------
/example/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@react-native/typescript-config/tsconfig.json"
3 | }
4 |
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: ["module:metro-react-native-babel-preset"],
3 | };
4 |
--------------------------------------------------------------------------------
/example/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: ['module:@react-native/babel-preset'],
3 | };
4 |
--------------------------------------------------------------------------------
/ios/ColorPickerIos-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "React/RCTBridgeModule.h"
2 | #import "React/RCTViewManager.h"
3 | #import "React/RCTEventEmitter.h"
4 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naturalclar/react-native-color-picker-ios/HEAD/example/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | ColorPickerIos_kotlinVersion=1.3.50
2 | ColorPickerIos_compileSdkVersion=28
3 | ColorPickerIos_buildToolsVersion=28.0.3
4 | ColorPickerIos_targetSdkVersion=28
5 |
--------------------------------------------------------------------------------
/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/example/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @format
3 | */
4 |
5 | import { AppRegistry } from "react-native";
6 | import App from "./src/App";
7 | import { name as appName } from "./app.json";
8 |
9 | AppRegistry.registerComponent(appName, () => App);
10 |
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | *.binlog
2 | *.hprof
3 | *.xcworkspace/
4 | *.zip
5 | .DS_Store
6 | .gradle/
7 | .idea/
8 | .vs/
9 | .xcode.env
10 | Pods/
11 | build/
12 | dist/*
13 | !dist/.gitignore
14 | local.properties
15 | msbuild.binlog
16 | node_modules/
17 |
--------------------------------------------------------------------------------
/ios/ColorPickerIos.m:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | #import
4 |
5 | @interface RCT_EXTERN_MODULE(RNCColorPicker, NSObject)
6 |
7 | RCT_EXTERN_METHOD(showColorPicker:(NSDictionary*)options callback:(RCTResponseSenderBlock*)callback)
8 |
9 | @end
10 |
11 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/example/metro.config.js:
--------------------------------------------------------------------------------
1 | const { makeMetroConfig } = require("@rnx-kit/metro-config");
2 | module.exports = makeMetroConfig({
3 | transformer: {
4 | getTransformOptions: async () => ({
5 | transform: {
6 | experimentalImportSupport: false,
7 | inlineRequires: false,
8 | },
9 | }),
10 | },
11 | });
12 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig helps developers define and maintain consistent
2 | # coding styles between different editors and IDEs
3 | # editorconfig.org
4 |
5 | root = true
6 |
7 | [*]
8 |
9 | indent_style = space
10 | indent_size = 2
11 |
12 | end_of_line = lf
13 | charset = utf-8
14 | trim_trailing_whitespace = true
15 | insert_final_newline = true
16 |
--------------------------------------------------------------------------------
/example/ios/Podfile:
--------------------------------------------------------------------------------
1 | ws_dir = Pathname.new(__dir__)
2 | ws_dir = ws_dir.parent until
3 | File.exist?("#{ws_dir}/node_modules/react-native-test-app/test_app.rb") ||
4 | ws_dir.expand_path.to_s == '/'
5 | require "#{ws_dir}/node_modules/react-native-test-app/test_app.rb"
6 |
7 | workspace 'Example.xcworkspace'
8 |
9 | use_test_app! :hermes_enabled => true
10 |
--------------------------------------------------------------------------------
/android/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | arguments=
2 | auto.sync=false
3 | build.scans.enabled=false
4 | connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(6.0))
5 | connection.project.dir=
6 | eclipse.preferences.version=1
7 | gradle.user.home=
8 | java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
9 | jvm.arguments=
10 | offline.mode=false
11 | override.workspace.settings=true
12 | show.console.view=true
13 | show.executions.view=true
14 |
--------------------------------------------------------------------------------
/android/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | android_
4 | Project android_ created by Buildship.
5 |
6 |
7 |
8 |
9 | org.eclipse.buildship.core.gradleprojectbuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.buildship.core.gradleprojectnature
16 |
17 |
18 |
--------------------------------------------------------------------------------
/example/react-native.config.js:
--------------------------------------------------------------------------------
1 | const project = (() => {
2 | try {
3 | const { configureProjects } = require("react-native-test-app");
4 | return configureProjects({
5 | android: {
6 | sourceDir: "android",
7 | },
8 | ios: {
9 | sourceDir: "ios",
10 | },
11 | windows: {
12 | sourceDir: "windows",
13 | solutionFile: "windows/Example.sln",
14 | },
15 | });
16 | } catch (_) {
17 | return undefined;
18 | }
19 | })();
20 |
21 | module.exports = {
22 | ...(project ? { project } : undefined),
23 | };
24 |
--------------------------------------------------------------------------------
/biome.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3 | "vcs": {
4 | "enabled": false,
5 | "clientKind": "git",
6 | "useIgnoreFile": false
7 | },
8 | "files": {
9 | "ignoreUnknown": false,
10 | "ignore": ["lib"]
11 | },
12 | "formatter": {
13 | "enabled": true,
14 | "indentStyle": "tab"
15 | },
16 | "organizeImports": {
17 | "enabled": true
18 | },
19 | "linter": {
20 | "enabled": true,
21 | "rules": {
22 | "recommended": true
23 | }
24 | },
25 | "javascript": {
26 | "formatter": {
27 | "quoteStyle": "double"
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | gradlePluginPortal()
4 | mavenCentral()
5 | google()
6 | }
7 | }
8 |
9 | rootProject.name = "Example"
10 |
11 | apply(from: {
12 | def searchDir = rootDir.toPath()
13 | do {
14 | def p = searchDir.resolve("node_modules/react-native-test-app/test-app.gradle")
15 | if (p.toFile().exists()) {
16 | return p.toRealPath().toString()
17 | }
18 | } while (searchDir = searchDir.getParent())
19 | throw new GradleException("Could not find `react-native-test-app`");
20 | }())
21 | applyTestAppSettings(settings)
22 |
--------------------------------------------------------------------------------
/example/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Example",
3 | "displayName": "Example",
4 | "components": [
5 | {
6 | "appKey": "Example",
7 | "displayName": "Example"
8 | }
9 | ],
10 | "resources": {
11 | "android": [
12 | "dist/res",
13 | "dist/main.android.jsbundle"
14 | ],
15 | "ios": [
16 | "dist/assets",
17 | "dist/main.ios.jsbundle"
18 | ],
19 | "macos": [
20 | "dist/assets",
21 | "dist/main.macos.jsbundle"
22 | ],
23 | "visionos": [
24 | "dist/assets",
25 | "dist/main.visionos.jsbundle"
26 | ],
27 | "windows": [
28 | "dist/assets",
29 | "dist/main.windows.bundle"
30 | ]
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/react-native-color-picker-ios.podspec:
--------------------------------------------------------------------------------
1 | require "json"
2 |
3 | package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4 |
5 | Pod::Spec.new do |s|
6 | s.name = "react-native-color-picker-ios"
7 | s.version = package["version"]
8 | s.summary = package["description"]
9 | s.homepage = package["homepage"]
10 | s.license = package["license"]
11 | s.authors = package["author"]
12 |
13 | s.platforms = { :ios => "9.0" }
14 | s.source = { :git => "https://github.com/Naturalclar/react-native-color-picker-ios.git", :tag => "#{s.version}" }
15 |
16 |
17 | s.source_files = "ios/**/*.{h,m,mm,swift}"
18 |
19 |
20 | s.dependency "React"
21 | end
22 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "baseUrl": ".",
4 | "paths": {
5 | "react-native-color-picker-ios": ["./src/index"]
6 | },
7 | "allowUnreachableCode": false,
8 | "allowUnusedLabels": false,
9 | "esModuleInterop": true,
10 | "forceConsistentCasingInFileNames": true,
11 | "jsx": "react",
12 | "lib": ["esnext"],
13 | "module": "esnext",
14 | "moduleResolution": "node",
15 | "noFallthroughCasesInSwitch": true,
16 | "noImplicitReturns": true,
17 | "noImplicitUseStrict": false,
18 | "noStrictGenericChecks": false,
19 | "noUnusedLocals": true,
20 | "noUnusedParameters": true,
21 | "resolveJsonModule": true,
22 | "skipLibCheck": true,
23 | "strict": true,
24 | "target": "esnext"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/android/src/main/java/com/reactnativecolorpickerios/ColorPickerIosModule.kt:
--------------------------------------------------------------------------------
1 | package com.reactnativecolorpickerios
2 |
3 | import com.facebook.react.bridge.ReactApplicationContext
4 | import com.facebook.react.bridge.ReactContextBaseJavaModule
5 | import com.facebook.react.bridge.ReactMethod
6 | import com.facebook.react.bridge.Promise
7 |
8 | class ColorPickerIosModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
9 |
10 | override fun getName(): String {
11 | return "ColorPickerIos"
12 | }
13 |
14 | // Example method
15 | // See https://facebook.github.io/react-native/docs/native-modules-android
16 | @ReactMethod
17 | fun multiply(a: Int, b: Int, promise: Promise) {
18 |
19 | promise.resolve(a * b)
20 |
21 | }
22 |
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/android/src/main/java/com/reactnativecolorpickerios/ColorPickerIosPackage.kt:
--------------------------------------------------------------------------------
1 | package com.reactnativecolorpickerios
2 |
3 | import java.util.Arrays
4 | import java.util.Collections
5 |
6 | import com.facebook.react.ReactPackage
7 | import com.facebook.react.bridge.NativeModule
8 | import com.facebook.react.bridge.ReactApplicationContext
9 | import com.facebook.react.uimanager.ViewManager
10 | import com.facebook.react.bridge.JavaScriptModule
11 |
12 | class ColorPickerIosPackage : ReactPackage {
13 | override fun createNativeModules(reactContext: ReactApplicationContext): List {
14 | return Arrays.asList(ColorPickerIosModule(reactContext))
15 | }
16 |
17 | override fun createViewManagers(reactContext: ReactApplicationContext): List> {
18 | return emptyList>()
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # OSX
2 | #
3 | .DS_Store
4 |
5 | # XDE
6 | .expo/
7 |
8 | # VSCode
9 | .vscode/
10 | jsconfig.json
11 |
12 | # Xcode
13 | #
14 | build/
15 | *.pbxuser
16 | !default.pbxuser
17 | *.mode1v3
18 | !default.mode1v3
19 | *.mode2v3
20 | !default.mode2v3
21 | *.perspectivev3
22 | !default.perspectivev3
23 | xcuserdata
24 | *.xccheckout
25 | *.moved-aside
26 | DerivedData
27 | *.hmap
28 | *.ipa
29 | *.xcuserstate
30 | project.xcworkspace
31 |
32 | # Android/IJ
33 | #
34 | .idea
35 | .gradle
36 | local.properties
37 | android.iml
38 |
39 | # Cocoapods
40 | #
41 | example/ios/Pods
42 |
43 | # node.js
44 | #
45 | node_modules/
46 | npm-debug.log
47 | yarn-debug.log
48 | yarn-error.log
49 |
50 | # BUCK
51 | buck-out/
52 | \.buckd/
53 | android/app/libs
54 | android/keystores/debug.keystore
55 |
56 | # Expo
57 | .expo/*
58 |
59 | # generated by bob
60 | lib/
61 |
62 | # yarn
63 | .yarn
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Jesse Katsumata
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: npm
4 | directory: "/"
5 | schedule:
6 | interval: daily
7 | time: "20:00"
8 | open-pull-requests-limit: 10
9 | ignore:
10 | - dependency-name: react-native
11 | versions:
12 | - "> 0.63.3, < 0.64"
13 | - dependency-name: pod-install
14 | versions:
15 | - 0.1.16
16 | - 0.1.17
17 | - 0.1.19
18 | - 0.1.20
19 | - dependency-name: eslint-config-prettier
20 | versions:
21 | - 8.0.0
22 | - 8.2.0
23 | - dependency-name: eslint
24 | versions:
25 | - 7.18.0
26 | - 7.19.0
27 | - 7.23.0
28 | - 7.24.0
29 | - dependency-name: release-it
30 | versions:
31 | - 14.2.2
32 | - 14.3.0
33 | - 14.4.0
34 | - 14.4.1
35 | - 14.5.0
36 | - 14.5.1
37 | - 14.6.0
38 | - dependency-name: "@types/react-native"
39 | versions:
40 | - 0.63.46
41 | - 0.63.47
42 | - 0.63.48
43 | - 0.63.49
44 | - 0.63.51
45 | - 0.64.0
46 | - 0.64.2
47 | - dependency-name: y18n
48 | versions:
49 | - 4.0.1
50 | - dependency-name: "@types/jest"
51 | versions:
52 | - 26.0.22
53 | - dependency-name: "@release-it/conventional-changelog"
54 | versions:
55 | - 2.0.1
56 | - dependency-name: react
57 | versions:
58 | - 17.0.1
59 | - dependency-name: typescript
60 | versions:
61 | - 4.1.3
62 | - 4.1.4
63 |
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | apply(from: {
3 | def searchDir = rootDir.toPath()
4 | do {
5 | def p = searchDir.resolve("node_modules/react-native-test-app/android/dependencies.gradle")
6 | if (p.toFile().exists()) {
7 | return p.toRealPath().toString()
8 | }
9 | } while (searchDir = searchDir.getParent())
10 | throw new GradleException("Could not find `react-native-test-app`");
11 | }())
12 |
13 | repositories {
14 | mavenCentral()
15 | google()
16 | }
17 |
18 | dependencies {
19 | getReactNativeDependencies().each { dependency ->
20 | classpath(dependency)
21 | }
22 | }
23 | }
24 |
25 | allprojects {
26 | repositories {
27 | maven {
28 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
29 | url({
30 | def searchDir = rootDir.toPath()
31 | do {
32 | def p = searchDir.resolve("node_modules/react-native/android")
33 | if (p.toFile().exists()) {
34 | return p.toRealPath().toString()
35 | }
36 | } while (searchDir = searchDir.getParent())
37 | throw new GradleException("Could not find `react-native`");
38 | }())
39 | }
40 | mavenCentral()
41 | google()
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/index.tsx:
--------------------------------------------------------------------------------
1 | import { type ColorValue, NativeModules, processColor } from "react-native";
2 |
3 | /**
4 | * Type of option used in JS side
5 | */
6 | type ColorPickerInputOptions = {
7 | /**
8 | * whether alpha is supported or not.
9 | * if true, user can chose the opacity of the color
10 | * @default false
11 | */
12 | supportsAlpha?: boolean;
13 | /**
14 | * initial color displayed on the picker
15 | */
16 | initialColor?: ColorValue;
17 | };
18 |
19 | /**
20 | * Actual options to be passed to Native Module
21 | */
22 | type ColorPickerNativeOptions = {
23 | supportsAlpha?: boolean;
24 | initialColor?: number | symbol | null;
25 | };
26 |
27 | type ColorPickerMethods = {
28 | showColorPicker: (
29 | /**
30 | * options for color picker
31 | */
32 | options?: ColorPickerNativeOptions,
33 | /**
34 | * callback method once color is chosen
35 | */
36 | callback?: (color: string) => void,
37 | ) => void;
38 | };
39 |
40 | const { RNCColorPicker } = NativeModules as {
41 | RNCColorPicker: ColorPickerMethods;
42 | };
43 |
44 | const ColorPicker = {
45 | showColorPicker: (
46 | options?: ColorPickerInputOptions,
47 | callback?: (color: string) => void,
48 | ) => {
49 | const convertedOptions = {
50 | ...options,
51 | initialColor: options?.initialColor
52 | ? processColor(options.initialColor)
53 | : undefined,
54 | };
55 |
56 | RNCColorPicker.showColorPicker(
57 | convertedOptions,
58 | callback ? callback : () => {},
59 | );
60 | },
61 | };
62 |
63 | export default ColorPicker;
64 |
--------------------------------------------------------------------------------
/example/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Example",
3 | "version": "0.0.1",
4 | "private": true,
5 | "scripts": {
6 | "android": "react-native run-android",
7 | "build:android": "npm run mkdist && react-native bundle --entry-file index.js --platform android --dev true --bundle-output dist/main.android.jsbundle --assets-dest dist/res",
8 | "build:ios": "npm run mkdist && react-native bundle --entry-file index.js --platform ios --dev true --bundle-output dist/main.ios.jsbundle --assets-dest dist",
9 | "ios": "react-native run-ios",
10 | "mkdist": "node -e \"require('node:fs').mkdirSync('dist', { recursive: true, mode: 0o755 })\"",
11 | "start": "react-native start",
12 | "test": "jest"
13 | },
14 | "dependencies": {
15 | "react": "18.3.1",
16 | "react-native": "0.76.3",
17 | "react-native-color-picker-ios": "^0.1.3"
18 | },
19 | "devDependencies": {
20 | "@babel/core": "^7.25.2",
21 | "@babel/preset-env": "^7.25.3",
22 | "@babel/runtime": "^7.25.0",
23 | "@react-native-community/cli": "15.0.1",
24 | "@react-native-community/cli-platform-android": "15.0.1",
25 | "@react-native-community/cli-platform-ios": "15.0.1",
26 | "@react-native/babel-preset": "0.76.3",
27 | "@react-native/metro-config": "0.76.3",
28 | "@react-native/typescript-config": "0.76.3",
29 | "@rnx-kit/metro-config": "^2.0.0",
30 | "@types/react": "^18.2.6",
31 | "@types/react-test-renderer": "^18.0.0",
32 | "babel-jest": "^29.6.3",
33 | "jest": "^29.6.3",
34 | "react-native-test-app": "^4.0.4",
35 | "react-test-renderer": "18.3.1",
36 | "typescript": "5.0.4"
37 | },
38 | "engines": {
39 | "node": ">=18"
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/example/src/App.tsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { useState } from "react";
3 | import {
4 | View,
5 | StyleSheet,
6 | SafeAreaView,
7 | TouchableOpacity,
8 | Text,
9 | useColorScheme,
10 | } from "react-native";
11 | import ColorPicker from "react-native-color-picker-ios";
12 |
13 | export default function App() {
14 | const colorScheme = useColorScheme();
15 |
16 | const [selectedColor, setSelectedColor] = useState(
17 | colorScheme === "dark" ? "#ddd" : "#000",
18 | );
19 | const handlePress = () => {
20 | ColorPicker.showColorPicker(
21 | { supportsAlpha: true, initialColor: selectedColor },
22 | (color) => {
23 | setSelectedColor(color);
24 | },
25 | );
26 | };
27 |
28 | const textStyle = React.useMemo(
29 | () => ({
30 | color: colorScheme === "dark" ? "#ddd" : "#000",
31 | }),
32 | [colorScheme],
33 | );
34 | return (
35 |
36 |
37 | Open Color Picker
38 |
39 |
40 | Currently selected color:
41 |
42 |
50 |
51 | );
52 | }
53 |
54 | const styles = StyleSheet.create({
55 | container: {
56 | flex: 1,
57 | justifyContent: "center",
58 | alignItems: "center",
59 | },
60 | textContainer: {
61 | marginBottom: 8,
62 | },
63 | selectedColorContainer: {
64 | width: 40,
65 | height: 40,
66 | borderRadius: 8,
67 | },
68 | });
69 |
--------------------------------------------------------------------------------
/ios/ColorPicker.swift:
--------------------------------------------------------------------------------
1 | @available(iOS 14.0, *)
2 | @objc(RNCColorPicker)
3 | class ColorPickerProxy: UIViewController, UIColorPickerViewControllerDelegate {
4 |
5 | var picker: UIColorPickerViewController!
6 | var supportsAlpha:Bool = false
7 | var initialColor:UIColor = UIColor(ciColor: .black)
8 | var callback: RCTResponseSenderBlock!
9 |
10 | @objc
11 | static func requiresMainQueueSetup() -> Bool {
12 | return true
13 | }
14 |
15 | @objc
16 | func showColorPicker(_ options:NSDictionary, callback:@escaping RCTResponseSenderBlock){
17 | if (options["supportsAlpha"] as? NSNumber == 1) {
18 | self.supportsAlpha = true
19 | }
20 | self.initialColor=RCTConvert.uiColor(options["initialColor"])
21 | self.callback=callback
22 |
23 | DispatchQueue.main.async {
24 | self.launchColorPicker()
25 | }
26 | }
27 |
28 | func launchColorPicker() {
29 | self.picker = UIColorPickerViewController()
30 | self.picker.delegate = self
31 |
32 | self.picker.supportsAlpha=self.supportsAlpha
33 | self.picker.selectedColor=self.initialColor
34 |
35 | if let root = RCTPresentedViewController() {
36 | root.present(self.picker, animated: true, completion: nil)
37 | }
38 | }
39 |
40 | // Called once you have finished picking the color.
41 | func colorPickerViewControllerDidFinish(_ viewController: UIColorPickerViewController) {
42 | let colorString = hexStringFromColor(color: viewController.selectedColor)
43 | self.callback([colorString])
44 | }
45 |
46 | func hexStringFromColor(color: UIColor) -> String {
47 | let rgba = color.cgColor.components
48 | let r: CGFloat = rgba?[0] ?? 0.0
49 | let g: CGFloat = rgba?[1] ?? 0.0
50 | let b: CGFloat = rgba?[2] ?? 0.0
51 | let a: CGFloat = rgba?[3] ?? 0.0
52 |
53 | let hexString = String(format: "#%02lX%02lX%02lX%02lX", lroundf(Float(r * 255)), lroundf(Float(g * 255)), lroundf(Float(b * 255)), lroundf(Float(a * 255)))
54 | return hexString
55 | }
56 | }
57 |
58 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the Gradle Daemon. The setting is
11 | # particularly useful for configuring JVM memory settings for build performance.
12 | # This does not affect the JVM settings for the Gradle client VM.
13 | # The default is `-Xmx512m -XX:MaxMetaspaceSize=256m`.
14 | org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
15 |
16 | # When configured, Gradle will fork up to org.gradle.workers.max JVMs to execute
17 | # projects in parallel. To learn more about parallel task execution, see the
18 | # section on Gradle build performance:
19 | # https://docs.gradle.org/current/userguide/performance.html#parallel_execution.
20 | # Default is `false`.
21 | #org.gradle.parallel=true
22 |
23 | # AndroidX package structure to make it clearer which packages are bundled with the
24 | # Android operating system, and which are packaged with your app's APK
25 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
26 | android.useAndroidX=true
27 | # Automatically convert third-party libraries to use AndroidX
28 | android.enableJetifier=true
29 | # Jetifier randomly fails on these libraries
30 | android.jetifier.ignorelist=hermes-android,react-android
31 |
32 | # Use this property to specify which architecture you want to build.
33 | # You can also override it from the CLI using
34 | # ./gradlew -PreactNativeArchitectures=x86_64
35 | reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
36 |
37 | # Use this property to enable support to the new architecture.
38 | # This will allow you to use TurboModules and the Fabric render in
39 | # your application. You should enable this flag either if you want
40 | # to write custom TurboModules/Fabric components OR use libraries that
41 | # are providing them.
42 | # Note that this is incompatible with web debugging.
43 | #newArchEnabled=true
44 | #bridgelessEnabled=true
45 |
46 | # Uncomment the line below to build React Native from source.
47 | #react.buildFromSource=true
48 |
49 | # Version of Android NDK to build against.
50 | #ANDROID_NDK_VERSION=26.1.10909125
51 |
52 | # Version of Kotlin to build against.
53 | #KOTLIN_VERSION=1.8.22
54 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-native-color-picker-ios",
3 | "version": "0.1.3",
4 | "description": "iOS14 Color Picker Module for React Native",
5 | "main": "lib/commonjs/index",
6 | "module": "lib/module/index",
7 | "types": "lib/typescript/src/index.d.ts",
8 | "react-native": "src/index",
9 | "source": "src/index",
10 | "files": [
11 | "src",
12 | "lib",
13 | "android",
14 | "ios",
15 | "cpp",
16 | "react-native-color-picker-ios.podspec",
17 | "!lib/typescript/example",
18 | "!**/__tests__",
19 | "!**/__fixtures__",
20 | "!**/__mocks__"
21 | ],
22 | "scripts": {
23 | "test": "jest",
24 | "typescript": "tsc --noEmit",
25 | "lint": "biome lint --write .",
26 | "format": "biome format --write .",
27 | "prepare": "bob build",
28 | "release": "release-it",
29 | "example": "yarn --cwd example"
30 | },
31 | "keywords": [
32 | "react-native",
33 | "ios",
34 | "android"
35 | ],
36 | "repository": "https://github.com/Naturalclar/react-native-color-picker-ios",
37 | "author": "Jesse Katsumata (https://github.com/Naturalclar)",
38 | "license": "MIT",
39 | "bugs": {
40 | "url": "https://github.com/Naturalclar/react-native-color-picker-ios/issues"
41 | },
42 | "homepage": "https://github.com/Naturalclar/react-native-color-picker-ios#readme",
43 | "devDependencies": {
44 | "@biomejs/biome": "1.9.4",
45 | "@react-native-community/bob": "^0.17.1",
46 | "@release-it/conventional-changelog": "^9.0.3",
47 | "@types/jest": "^29.1.2",
48 | "@types/react": "^18.2.6",
49 | "jest": "^29.6.3",
50 | "react": "18.3.1",
51 | "react-native": "0.76.3",
52 | "react-native-test-app": "^4.0.4",
53 | "release-it": "^17.2.1",
54 | "typescript": "5.9.2"
55 | },
56 | "peerDependencies": {
57 | "react": "*",
58 | "react-native": "*"
59 | },
60 | "jest": {
61 | "preset": "react-native",
62 | "modulePathIgnorePatterns": [
63 | "/example/node_modules",
64 | "/lib/"
65 | ]
66 | },
67 | "release-it": {
68 | "git": {
69 | "commitMessage": "chore: release ${version}",
70 | "tagName": "v${version}"
71 | },
72 | "npm": {
73 | "publish": true
74 | },
75 | "plugins": {
76 | "@release-it/conventional-changelog": {
77 | "preset": "angular"
78 | }
79 | }
80 | },
81 | "@react-native-community/bob": {
82 | "source": "src",
83 | "output": "lib",
84 | "targets": [
85 | "commonjs",
86 | "module",
87 | "typescript"
88 | ]
89 | },
90 | "packageManager": "yarn@1.22.22+sha256.c17d3797fb9a9115bf375e31bfd30058cac6bc9c3b8807a3d8cb2094794b51ca"
91 | }
92 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # react-native-color-picker-ios
2 |
3 | [![BuildStatus][build-badge]][build]
4 | [![Version][version-badge]][package]
5 | [![MIT License][license-badge]][license]
6 |
7 | iOS14 Color Picker Module for React Native
8 |
9 | | Grid | Spectrum | Sliders |
10 | | --- | --- | --- |
11 | |
|
|
|
12 |
13 | ## Installation
14 |
15 | - using `npm`:
16 |
17 | ```sh
18 | npm install react-native-color-picker-ios
19 | ```
20 |
21 | - using `yarn`:
22 |
23 | ```sh
24 | yarn add react-native-color-picker-ios
25 | ```
26 |
27 | ## Usage
28 |
29 | ```jsx
30 | import * as React from 'react';
31 | import { View, Text, TouchableOpacity } from 'react-native';
32 | import ColorPicker from 'react-native-color-picker-ios';
33 |
34 | const ColorSelectComponent = () => {
35 | const handlePress = () => {
36 | ColorPicker.showColorPicker(
37 | { supportsAlpha: true, initialColor: 'cyan' },
38 | (color) => {
39 | console.log(color);
40 | }
41 | );
42 | };
43 |
44 | return (
45 |
46 | Click to Select Color
47 |
48 | );
49 | };
50 | ```
51 |
52 | ## Reference
53 |
54 | ### Methods
55 |
56 | ### `showColorPicker()`
57 |
58 | ```jsx
59 | ColorPicker.showColorPicker(options, callback);
60 | ```
61 |
62 | Displays the color picker modal, and runs callback function with selected color.
63 |
64 | #### Options
65 |
66 | | Name | Type | Required | default | Description |
67 | | ------------- | ------- | -------- | ------- | ---------------------------------------------------------- |
68 | | supportsAlpha | boolean | NO | false | if `true`, user are allowed to chose opacity of the color. |
69 | | initialColor | string | NO | `#000` | sets initialColor selected by the picker |
70 |
71 | ## Contributing
72 |
73 | See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
74 |
75 | ## License
76 |
77 | MIT
78 |
79 | [build-badge]: https://github.com/Naturalclar/color-picker-ios/workflows/Build/badge.svg
80 | [build]: https://github.com/Naturalclar/color-picker-ios/actions
81 | [version-badge]: https://img.shields.io/npm/v/react-native-color-picker-ios.svg?style=flat-square
82 | [package]: https://www.npmjs.com/package/react-native-color-picker-ios
83 | [license-badge]: https://img.shields.io/npm/l/react-native-color-picker-ios.svg?style=flat-square
84 | [license]: https://opensource.org/licenses/MIT
85 |
--------------------------------------------------------------------------------
/example/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%"=="" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%"=="" set DIRNAME=.
29 | @rem This is normally unused
30 | set APP_BASE_NAME=%~n0
31 | set APP_HOME=%DIRNAME%
32 |
33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
35 |
36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
38 |
39 | @rem Find java.exe
40 | if defined JAVA_HOME goto findJavaFromJavaHome
41 |
42 | set JAVA_EXE=java.exe
43 | %JAVA_EXE% -version >NUL 2>&1
44 | if %ERRORLEVEL% equ 0 goto execute
45 |
46 | echo. 1>&2
47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
48 | echo. 1>&2
49 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
50 | echo location of your Java installation. 1>&2
51 |
52 | goto fail
53 |
54 | :findJavaFromJavaHome
55 | set JAVA_HOME=%JAVA_HOME:"=%
56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
57 |
58 | if exist "%JAVA_EXE%" goto execute
59 |
60 | echo. 1>&2
61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
62 | echo. 1>&2
63 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
64 | echo location of your Java installation. 1>&2
65 |
66 | goto fail
67 |
68 | :execute
69 | @rem Setup the command line
70 |
71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
72 |
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if %ERRORLEVEL% equ 0 goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | set EXIT_CODE=%ERRORLEVEL%
85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1
86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
87 | exit /b %EXIT_CODE%
88 |
89 | :mainEnd
90 | if "%OS%"=="Windows_NT" endlocal
91 |
92 | :omega
93 |
--------------------------------------------------------------------------------
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: Build
2 | on: push
3 |
4 | jobs:
5 | lint:
6 | runs-on: ubuntu-latest
7 | strategy:
8 | matrix:
9 | node-version: [22]
10 | steps:
11 | - uses: actions/checkout@v2
12 | - uses: actions/setup-node@v1
13 | with:
14 | node-version: ${{ matrix.node-version }}
15 | - name: Get yarn cache
16 | id: yarn-cache
17 | run: echo "::set-output name=dir::$(yarn cache dir)"
18 | - uses: actions/cache@v4
19 | with:
20 | path: ${{ steps.yarn-cache.outputs.dir }}
21 | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
22 | - name: Install Dependencies
23 | run: yarn
24 | - name: ESLint Checks
25 | run: yarn lint
26 | tsc:
27 | runs-on: ubuntu-latest
28 | strategy:
29 | matrix:
30 | node-version: [22]
31 | steps:
32 | - uses: actions/checkout@v2
33 | - uses: actions/setup-node@v1
34 | with:
35 | node-version: ${{ matrix.node-version }}
36 | - name: Get yarn cache
37 | id: yarn-cache
38 | run: echo "::set-output name=dir::$(yarn cache dir)"
39 | - uses: actions/cache@v4
40 | with:
41 | path: ${{ steps.yarn-cache.outputs.dir }}
42 | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
43 | - name: Install Dependencies
44 | run: yarn
45 | - name: TypeScript type check
46 | run: yarn typescript
47 | android:
48 | runs-on: ubuntu-latest
49 | strategy:
50 | matrix:
51 | node-version: [22]
52 | java-version: [17]
53 | steps:
54 | - uses: actions/checkout@v2
55 | - uses: actions/setup-node@v1
56 | with:
57 | node-version: ${{ matrix.node-version }}
58 | - uses: actions/setup-java@v3
59 | with:
60 | distribution: "zulu" # See 'Supported distributions' for available options
61 | java-version: ${{ matrix.java-version }}
62 | - name: Get yarn cache
63 | id: yarn-cache
64 | run: echo "::set-output name=dir::$(yarn cache dir)"
65 | - uses: actions/cache@v4
66 | with:
67 | path: ${{ steps.yarn-cache.outputs.dir }}
68 | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
69 | - name: Install Dependencies
70 | run: yarn
71 | - name: Install Example
72 | run: cd example && yarn
73 | - name: Build android
74 | run: cd example && yarn build:android
75 | - name: Build Android Example App and Library
76 | run: cd example/android && ./gradlew clean assembleDebug
77 | ios:
78 | runs-on: macos-latest
79 | strategy:
80 | matrix:
81 | node-version: [22]
82 | steps:
83 | - uses: actions/checkout@v2
84 | - uses: actions/setup-node@v1
85 | with:
86 | node-version: ${{ matrix.node-version }}
87 | - name: Get yarn cache
88 | id: yarn-cache
89 | run: echo "::set-output name=dir::$(yarn cache dir)"
90 | - uses: actions/cache@v4
91 | with:
92 | path: ${{ steps.yarn-cache.outputs.dir }}
93 | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
94 | - name: Install Dependencies
95 | run: yarn
96 | - name: Install Example
97 | run: cd example && yarn
98 | - name: Build ios
99 | run: cd example && yarn build:ios
100 | - name: Pod install
101 | run: cd example && pod install --project-directory=ios
102 | - name: Run ios app
103 | run: cd example && yarn ios --no-packager
104 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | // Buildscript is evaluated before everything else so we can't use getExtOrDefault
3 | def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['ColorPickerIos_kotlinVersion']
4 |
5 | repositories {
6 | google()
7 | jcenter()
8 | }
9 |
10 | dependencies {
11 | classpath 'com.android.tools.build:gradle:3.2.1'
12 | // noinspection DifferentKotlinGradleVersion
13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14 | }
15 | }
16 |
17 | apply plugin: 'com.android.library'
18 | apply plugin: 'kotlin-android'
19 |
20 | def getExtOrDefault(name) {
21 | return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['ColorPickerIos_' + name]
22 | }
23 |
24 | def getExtOrIntegerDefault(name) {
25 | return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['ColorPickerIos_' + name]).toInteger()
26 | }
27 |
28 | android {
29 | compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
30 | buildToolsVersion getExtOrDefault('buildToolsVersion')
31 | defaultConfig {
32 | minSdkVersion 16
33 | targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
34 | versionCode 1
35 | versionName "1.0"
36 |
37 | }
38 |
39 | buildTypes {
40 | release {
41 | minifyEnabled false
42 | }
43 | }
44 | lintOptions {
45 | disable 'GradleCompatible'
46 | }
47 | compileOptions {
48 | sourceCompatibility JavaVersion.VERSION_1_8
49 | targetCompatibility JavaVersion.VERSION_1_8
50 | }
51 | }
52 |
53 | repositories {
54 | mavenCentral()
55 | jcenter()
56 | google()
57 |
58 | def found = false
59 | def defaultDir = null
60 | def androidSourcesName = 'React Native sources'
61 |
62 | if (rootProject.ext.has('reactNativeAndroidRoot')) {
63 | defaultDir = rootProject.ext.get('reactNativeAndroidRoot')
64 | } else {
65 | defaultDir = new File(
66 | projectDir,
67 | '/../../../node_modules/react-native/android'
68 | )
69 | }
70 |
71 | if (defaultDir.exists()) {
72 | maven {
73 | url defaultDir.toString()
74 | name androidSourcesName
75 | }
76 |
77 | logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}")
78 | found = true
79 | } else {
80 | def parentDir = rootProject.projectDir
81 |
82 | 1.upto(5, {
83 | if (found) return true
84 | parentDir = parentDir.parentFile
85 |
86 | def androidSourcesDir = new File(
87 | parentDir,
88 | 'node_modules/react-native'
89 | )
90 |
91 | def androidPrebuiltBinaryDir = new File(
92 | parentDir,
93 | 'node_modules/react-native/android'
94 | )
95 |
96 | if (androidPrebuiltBinaryDir.exists()) {
97 | maven {
98 | url androidPrebuiltBinaryDir.toString()
99 | name androidSourcesName
100 | }
101 |
102 | logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}")
103 | found = true
104 | } else if (androidSourcesDir.exists()) {
105 | maven {
106 | url androidSourcesDir.toString()
107 | name androidSourcesName
108 | }
109 |
110 | logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}")
111 | found = true
112 | }
113 | })
114 | }
115 |
116 | if (!found) {
117 | throw new GradleException(
118 | "${project.name}: unable to locate React Native android sources. " +
119 | "Ensure you have you installed React Native as a dependency in your project and try again."
120 | )
121 | }
122 | }
123 |
124 | def kotlin_version = getExtOrDefault('kotlinVersion')
125 |
126 | dependencies {
127 | // noinspection GradleDynamicVersion
128 | api 'com.facebook.react:react-native:+'
129 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
130 | }
131 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project.
4 |
5 | ## Development workflow
6 |
7 | To get started with the project, run `yarn bootstrap` in the root directory to install the required dependencies for each package:
8 |
9 | ```sh
10 | yarn bootstrap
11 | ```
12 |
13 | While developing, you can run the [example app](/example/) to test your changes.
14 |
15 | To start the packager:
16 |
17 | ```sh
18 | yarn example start
19 | ```
20 |
21 | To run the example app on Android:
22 |
23 | ```sh
24 | yarn example android
25 | ```
26 |
27 | To run the example app on iOS:
28 |
29 | ```sh
30 | yarn example ios
31 | ```
32 |
33 | Make sure your code passes TypeScript and ESLint. Run the following to verify:
34 |
35 | ```sh
36 | yarn typescript
37 | yarn lint
38 | ```
39 |
40 | To fix formatting errors, run the following:
41 |
42 | ```sh
43 | yarn lint --fix
44 | ```
45 |
46 | Remember to add tests for your change if possible. Run the unit tests by:
47 |
48 | ```sh
49 | yarn test
50 | ```
51 |
52 | To edit the Objective-C files, open `example/ios/ColorPickerIosExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-color-picker-ios`.
53 |
54 | To edit the Kotlin files, open `example/android` in Android studio and find the source files at `reactnativecolorpickerios` under `Android`.
55 |
56 | ### Commit message convention
57 |
58 | We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages:
59 |
60 | - `fix`: bug fixes, e.g. fix crash due to deprecated method.
61 | - `feat`: new features, e.g. add new method to the module.
62 | - `refactor`: code refactor, e.g. migrate from class components to hooks.
63 | - `docs`: changes into documentation, e.g. add usage example for the module..
64 | - `test`: adding or updating tests, eg add integration tests using detox.
65 | - `chore`: tooling changes, e.g. change CI config.
66 |
67 | Our pre-commit hooks verify that your commit message matches this format when committing.
68 |
69 | ### Linting and tests
70 |
71 | [ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/)
72 |
73 | We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint](https://eslint.org/) with [Prettier](https://prettier.io/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing.
74 |
75 | Our pre-commit hooks verify that the linter and tests pass when committing.
76 |
77 | ### Scripts
78 |
79 | The `package.json` file contains various scripts for common tasks:
80 |
81 | - `yarn bootstrap`: setup project by installing all dependencies and pods.
82 | - `yarn typescript`: type-check files with TypeScript.
83 | - `yarn lint`: lint files with ESLint.
84 | - `yarn test`: run unit tests with Jest.
85 | - `yarn example start`: start the Metro server for the example app.
86 | - `yarn example android`: run the example app on Android.
87 | - `yarn example ios`: run the example app on iOS.
88 |
89 | ### Sending a pull request
90 |
91 | > **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github).
92 |
93 | When you're sending a pull request:
94 |
95 | - Prefer small pull requests focused on one change.
96 | - Verify that linters and tests are passing.
97 | - Review the documentation to make sure it looks good.
98 | - Follow the pull request template when opening a pull request.
99 | - For pull requests that change the API or implementation, discuss with maintainers first by opening an issue.
100 |
101 | ## Code of Conduct
102 |
103 | ### Our Pledge
104 |
105 | We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
106 |
107 | We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
108 |
109 | ### Our Standards
110 |
111 | Examples of behavior that contributes to a positive environment for our community include:
112 |
113 | - Demonstrating empathy and kindness toward other people
114 | - Being respectful of differing opinions, viewpoints, and experiences
115 | - Giving and gracefully accepting constructive feedback
116 | - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
117 | - Focusing on what is best not just for us as individuals, but for the overall community
118 |
119 | Examples of unacceptable behavior include:
120 |
121 | - The use of sexualized language or imagery, and sexual attention or
122 | advances of any kind
123 | - Trolling, insulting or derogatory comments, and personal or political attacks
124 | - Public or private harassment
125 | - Publishing others' private information, such as a physical or email
126 | address, without their explicit permission
127 | - Other conduct which could reasonably be considered inappropriate in a
128 | professional setting
129 |
130 | ### Enforcement Responsibilities
131 |
132 | Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
133 |
134 | Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
135 |
136 | ### Scope
137 |
138 | This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
139 |
140 | ### Enforcement
141 |
142 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly.
143 |
144 | All community leaders are obligated to respect the privacy and security of the reporter of any incident.
145 |
146 | ### Enforcement Guidelines
147 |
148 | Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
149 |
150 | #### 1. Correction
151 |
152 | **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
153 |
154 | **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
155 |
156 | #### 2. Warning
157 |
158 | **Community Impact**: A violation through a single incident or series of actions.
159 |
160 | **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
161 |
162 | #### 3. Temporary Ban
163 |
164 | **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
165 |
166 | **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
167 |
168 | #### 4. Permanent Ban
169 |
170 | **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
171 |
172 | **Consequence**: A permanent ban from any sort of public interaction within the community.
173 |
174 | ### Attribution
175 |
176 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
177 | available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
178 |
179 | Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
180 |
181 | [homepage]: https://www.contributor-covenant.org
182 |
183 | For answers to common questions about this code of conduct, see the FAQ at
184 | https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
185 |
--------------------------------------------------------------------------------
/example/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | #
4 | # Copyright © 2015-2021 the original authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | #
21 | # Gradle start up script for POSIX generated by Gradle.
22 | #
23 | # Important for running:
24 | #
25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
26 | # noncompliant, but you have some other compliant shell such as ksh or
27 | # bash, then to run this script, type that shell name before the whole
28 | # command line, like:
29 | #
30 | # ksh Gradle
31 | #
32 | # Busybox and similar reduced shells will NOT work, because this script
33 | # requires all of these POSIX shell features:
34 | # * functions;
35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»;
37 | # * compound commands having a testable exit status, especially «case»;
38 | # * various built-in commands including «command», «set», and «ulimit».
39 | #
40 | # Important for patching:
41 | #
42 | # (2) This script targets any POSIX shell, so it avoids extensions provided
43 | # by Bash, Ksh, etc; in particular arrays are avoided.
44 | #
45 | # The "traditional" practice of packing multiple parameters into a
46 | # space-separated string is a well documented source of bugs and security
47 | # problems, so this is (mostly) avoided, by progressively accumulating
48 | # options in "$@", and eventually passing that to Java.
49 | #
50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
52 | # see the in-line comments for details.
53 | #
54 | # There are tweaks for specific operating systems such as AIX, CygWin,
55 | # Darwin, MinGW, and NonStop.
56 | #
57 | # (3) This script is generated from the Groovy template
58 | # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
59 | # within the Gradle project.
60 | #
61 | # You can find Gradle at https://github.com/gradle/gradle/.
62 | #
63 | ##############################################################################
64 |
65 | # Attempt to set APP_HOME
66 |
67 | # Resolve links: $0 may be a link
68 | app_path=$0
69 |
70 | # Need this for daisy-chained symlinks.
71 | while
72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
73 | [ -h "$app_path" ]
74 | do
75 | ls=$( ls -ld "$app_path" )
76 | link=${ls#*' -> '}
77 | case $link in #(
78 | /*) app_path=$link ;; #(
79 | *) app_path=$APP_HOME$link ;;
80 | esac
81 | done
82 |
83 | # This is normally unused
84 | # shellcheck disable=SC2034
85 | APP_BASE_NAME=${0##*/}
86 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87 | APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
88 |
89 | # Use the maximum available, or set MAX_FD != -1 to use that value.
90 | MAX_FD=maximum
91 |
92 | warn () {
93 | echo "$*"
94 | } >&2
95 |
96 | die () {
97 | echo
98 | echo "$*"
99 | echo
100 | exit 1
101 | } >&2
102 |
103 | # OS specific support (must be 'true' or 'false').
104 | cygwin=false
105 | msys=false
106 | darwin=false
107 | nonstop=false
108 | case "$( uname )" in #(
109 | CYGWIN* ) cygwin=true ;; #(
110 | Darwin* ) darwin=true ;; #(
111 | MSYS* | MINGW* ) msys=true ;; #(
112 | NONSTOP* ) nonstop=true ;;
113 | esac
114 |
115 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
116 |
117 |
118 | # Determine the Java command to use to start the JVM.
119 | if [ -n "$JAVA_HOME" ] ; then
120 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
121 | # IBM's JDK on AIX uses strange locations for the executables
122 | JAVACMD=$JAVA_HOME/jre/sh/java
123 | else
124 | JAVACMD=$JAVA_HOME/bin/java
125 | fi
126 | if [ ! -x "$JAVACMD" ] ; then
127 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
128 |
129 | Please set the JAVA_HOME variable in your environment to match the
130 | location of your Java installation."
131 | fi
132 | else
133 | JAVACMD=java
134 | if ! command -v java >/dev/null 2>&1
135 | then
136 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137 |
138 | Please set the JAVA_HOME variable in your environment to match the
139 | location of your Java installation."
140 | fi
141 | fi
142 |
143 | # Increase the maximum file descriptors if we can.
144 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
145 | case $MAX_FD in #(
146 | max*)
147 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
148 | # shellcheck disable=SC2039,SC3045
149 | MAX_FD=$( ulimit -H -n ) ||
150 | warn "Could not query maximum file descriptor limit"
151 | esac
152 | case $MAX_FD in #(
153 | '' | soft) :;; #(
154 | *)
155 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
156 | # shellcheck disable=SC2039,SC3045
157 | ulimit -n "$MAX_FD" ||
158 | warn "Could not set maximum file descriptor limit to $MAX_FD"
159 | esac
160 | fi
161 |
162 | # Collect all arguments for the java command, stacking in reverse order:
163 | # * args from the command line
164 | # * the main class name
165 | # * -classpath
166 | # * -D...appname settings
167 | # * --module-path (only if needed)
168 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
169 |
170 | # For Cygwin or MSYS, switch paths to Windows format before running java
171 | if "$cygwin" || "$msys" ; then
172 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
173 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
174 |
175 | JAVACMD=$( cygpath --unix "$JAVACMD" )
176 |
177 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
178 | for arg do
179 | if
180 | case $arg in #(
181 | -*) false ;; # don't mess with options #(
182 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
183 | [ -e "$t" ] ;; #(
184 | *) false ;;
185 | esac
186 | then
187 | arg=$( cygpath --path --ignore --mixed "$arg" )
188 | fi
189 | # Roll the args list around exactly as many times as the number of
190 | # args, so each arg winds up back in the position where it started, but
191 | # possibly modified.
192 | #
193 | # NB: a `for` loop captures its iteration list before it begins, so
194 | # changing the positional parameters here affects neither the number of
195 | # iterations, nor the values presented in `arg`.
196 | shift # remove old arg
197 | set -- "$@" "$arg" # push replacement arg
198 | done
199 | fi
200 |
201 |
202 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
203 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204 |
205 | # Collect all arguments for the java command:
206 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
207 | # and any embedded shellness will be escaped.
208 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
209 | # treated as '${Hostname}' itself on the command line.
210 |
211 | set -- \
212 | "-Dorg.gradle.appname=$APP_BASE_NAME" \
213 | -classpath "$CLASSPATH" \
214 | org.gradle.wrapper.GradleWrapperMain \
215 | "$@"
216 |
217 | # Stop when "xargs" is not available.
218 | if ! command -v xargs >/dev/null 2>&1
219 | then
220 | die "xargs is not available"
221 | fi
222 |
223 | # Use "xargs" to parse quoted args.
224 | #
225 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed.
226 | #
227 | # In Bash we could simply go:
228 | #
229 | # readarray ARGS < <( xargs -n1 <<<"$var" ) &&
230 | # set -- "${ARGS[@]}" "$@"
231 | #
232 | # but POSIX shell has neither arrays nor command substitution, so instead we
233 | # post-process each arg (as a line of input to sed) to backslash-escape any
234 | # character that might be a shell metacharacter, then use eval to reverse
235 | # that process (while maintaining the separation between arguments), and wrap
236 | # the whole thing up as a single "set" statement.
237 | #
238 | # This will of course break if any of these variables contains a newline or
239 | # an unmatched quote.
240 | #
241 |
242 | eval "set -- $(
243 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
244 | xargs -n1 |
245 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
246 | tr '\n' ' '
247 | )" '"$@"'
248 |
249 | exec "$JAVACMD" "$@"
250 |
--------------------------------------------------------------------------------
/ios/ColorPickerIos.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 |
11 |
12 | F4FF95D7245B92E800C19C63 /* ColorPickerIos.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4FF95D6245B92E800C19C63 /* ColorPickerIos.swift */; };
13 |
14 | 5E555C0D2413F4C50049A1A2 /* ColorPickerIos.mm in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* ColorPickerIos.mm */; };
15 | /* End PBXBuildFile section */
16 |
17 | /* Begin PBXCopyFilesBuildPhase section */
18 | 58B511D91A9E6C8500147676 /* CopyFiles */ = {
19 | isa = PBXCopyFilesBuildPhase;
20 | buildActionMask = 2147483647;
21 | dstPath = "include/$(PRODUCT_NAME)";
22 | dstSubfolderSpec = 16;
23 | files = (
24 | );
25 | runOnlyForDeploymentPostprocessing = 0;
26 | };
27 | /* End PBXCopyFilesBuildPhase section */
28 |
29 | /* Begin PBXFileReference section */
30 | 134814201AA4EA6300B7C361 /* libColorPickerIos.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libColorPickerIos.a; sourceTree = BUILT_PRODUCTS_DIR; };
31 |
32 |
33 | B3E7B5891CC2AC0600A0062D /* ColorPickerIos.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ColorPickerIos.m; sourceTree = ""; };
34 | F4FF95D5245B92E700C19C63 /* ColorPickerIos-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ColorPickerIos-Bridging-Header.h"; sourceTree = ""; };
35 | F4FF95D6245B92E800C19C63 /* ColorPickerIos.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorPickerIos.swift; sourceTree = ""; };
36 |
37 | /* End PBXFileReference section */
38 |
39 | /* Begin PBXFrameworksBuildPhase section */
40 | 58B511D81A9E6C8500147676 /* Frameworks */ = {
41 | isa = PBXFrameworksBuildPhase;
42 | buildActionMask = 2147483647;
43 | files = (
44 | );
45 | runOnlyForDeploymentPostprocessing = 0;
46 | };
47 | /* End PBXFrameworksBuildPhase section */
48 |
49 | /* Begin PBXGroup section */
50 | 134814211AA4EA7D00B7C361 /* Products */ = {
51 | isa = PBXGroup;
52 | children = (
53 | 134814201AA4EA6300B7C361 /* libColorPickerIos.a */,
54 | );
55 | name = Products;
56 | sourceTree = "";
57 | };
58 | 58B511D21A9E6C8500147676 = {
59 | isa = PBXGroup;
60 | children = (
61 |
62 |
63 | F4FF95D6245B92E800C19C63 /* ColorPickerIos.swift */,
64 | B3E7B5891CC2AC0600A0062D /* ColorPickerIos.m */,
65 | F4FF95D5245B92E700C19C63 /* ColorPickerIos-Bridging-Header.h */,
66 |
67 | 134814211AA4EA7D00B7C361 /* Products */,
68 | );
69 | sourceTree = "";
70 | };
71 | /* End PBXGroup section */
72 |
73 | /* Begin PBXNativeTarget section */
74 | 58B511DA1A9E6C8500147676 /* ColorPickerIos */ = {
75 | isa = PBXNativeTarget;
76 | buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "ColorPickerIos" */;
77 | buildPhases = (
78 | 58B511D71A9E6C8500147676 /* Sources */,
79 | 58B511D81A9E6C8500147676 /* Frameworks */,
80 | 58B511D91A9E6C8500147676 /* CopyFiles */,
81 | );
82 | buildRules = (
83 | );
84 | dependencies = (
85 | );
86 | name = ColorPickerIos;
87 | productName = RCTDataManager;
88 | productReference = 134814201AA4EA6300B7C361 /* libColorPickerIos.a */;
89 | productType = "com.apple.product-type.library.static";
90 | };
91 | /* End PBXNativeTarget section */
92 |
93 | /* Begin PBXProject section */
94 | 58B511D31A9E6C8500147676 /* Project object */ = {
95 | isa = PBXProject;
96 | attributes = {
97 | LastUpgradeCheck = 0920;
98 | ORGANIZATIONNAME = Facebook;
99 | TargetAttributes = {
100 | 58B511DA1A9E6C8500147676 = {
101 | CreatedOnToolsVersion = 6.1.1;
102 | };
103 | };
104 | };
105 | buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "ColorPickerIos" */;
106 | compatibilityVersion = "Xcode 3.2";
107 | developmentRegion = English;
108 | hasScannedForEncodings = 0;
109 | knownRegions = (
110 | English,
111 | en,
112 | );
113 | mainGroup = 58B511D21A9E6C8500147676;
114 | productRefGroup = 58B511D21A9E6C8500147676;
115 | projectDirPath = "";
116 | projectRoot = "";
117 | targets = (
118 | 58B511DA1A9E6C8500147676 /* ColorPickerIos */,
119 | );
120 | };
121 | /* End PBXProject section */
122 |
123 | /* Begin PBXSourcesBuildPhase section */
124 | 58B511D71A9E6C8500147676 /* Sources */ = {
125 | isa = PBXSourcesBuildPhase;
126 | buildActionMask = 2147483647;
127 | files = (
128 |
129 |
130 | F4FF95D7245B92E800C19C63 /* ColorPickerIos.swift in Sources */,
131 | B3E7B58A1CC2AC0600A0062D /* ColorPickerIos.m in Sources */,
132 |
133 | );
134 | runOnlyForDeploymentPostprocessing = 0;
135 | };
136 | /* End PBXSourcesBuildPhase section */
137 |
138 | /* Begin XCBuildConfiguration section */
139 | 58B511ED1A9E6C8500147676 /* Debug */ = {
140 | isa = XCBuildConfiguration;
141 | buildSettings = {
142 | ALWAYS_SEARCH_USER_PATHS = NO;
143 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
144 | CLANG_CXX_LIBRARY = "libc++";
145 | CLANG_ENABLE_MODULES = YES;
146 | CLANG_ENABLE_OBJC_ARC = YES;
147 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
148 | CLANG_WARN_BOOL_CONVERSION = YES;
149 | CLANG_WARN_COMMA = YES;
150 | CLANG_WARN_CONSTANT_CONVERSION = YES;
151 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
152 | CLANG_WARN_EMPTY_BODY = YES;
153 | CLANG_WARN_ENUM_CONVERSION = YES;
154 | CLANG_WARN_INFINITE_RECURSION = YES;
155 | CLANG_WARN_INT_CONVERSION = YES;
156 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
157 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
158 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
159 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
160 | CLANG_WARN_STRICT_PROTOTYPES = YES;
161 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
162 | CLANG_WARN_UNREACHABLE_CODE = YES;
163 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
164 | COPY_PHASE_STRIP = NO;
165 | ENABLE_STRICT_OBJC_MSGSEND = YES;
166 | ENABLE_TESTABILITY = YES;
167 | GCC_C_LANGUAGE_STANDARD = gnu99;
168 | GCC_DYNAMIC_NO_PIC = NO;
169 | GCC_NO_COMMON_BLOCKS = YES;
170 | GCC_OPTIMIZATION_LEVEL = 0;
171 | GCC_PREPROCESSOR_DEFINITIONS = (
172 | "DEBUG=1",
173 | "$(inherited)",
174 | );
175 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
176 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
177 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
178 | GCC_WARN_UNDECLARED_SELECTOR = YES;
179 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
180 | GCC_WARN_UNUSED_FUNCTION = YES;
181 | GCC_WARN_UNUSED_VARIABLE = YES;
182 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
183 | MTL_ENABLE_DEBUG_INFO = YES;
184 | ONLY_ACTIVE_ARCH = YES;
185 | SDKROOT = iphoneos;
186 | };
187 | name = Debug;
188 | };
189 | 58B511EE1A9E6C8500147676 /* Release */ = {
190 | isa = XCBuildConfiguration;
191 | buildSettings = {
192 | ALWAYS_SEARCH_USER_PATHS = NO;
193 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
194 | CLANG_CXX_LIBRARY = "libc++";
195 | CLANG_ENABLE_MODULES = YES;
196 | CLANG_ENABLE_OBJC_ARC = YES;
197 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
198 | CLANG_WARN_BOOL_CONVERSION = YES;
199 | CLANG_WARN_COMMA = YES;
200 | CLANG_WARN_CONSTANT_CONVERSION = YES;
201 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
202 | CLANG_WARN_EMPTY_BODY = YES;
203 | CLANG_WARN_ENUM_CONVERSION = YES;
204 | CLANG_WARN_INFINITE_RECURSION = YES;
205 | CLANG_WARN_INT_CONVERSION = YES;
206 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
207 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
208 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
209 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
210 | CLANG_WARN_STRICT_PROTOTYPES = YES;
211 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
212 | CLANG_WARN_UNREACHABLE_CODE = YES;
213 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
214 | COPY_PHASE_STRIP = YES;
215 | ENABLE_NS_ASSERTIONS = NO;
216 | ENABLE_STRICT_OBJC_MSGSEND = YES;
217 | GCC_C_LANGUAGE_STANDARD = gnu99;
218 | GCC_NO_COMMON_BLOCKS = YES;
219 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
220 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
221 | GCC_WARN_UNDECLARED_SELECTOR = YES;
222 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
223 | GCC_WARN_UNUSED_FUNCTION = YES;
224 | GCC_WARN_UNUSED_VARIABLE = YES;
225 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
226 | MTL_ENABLE_DEBUG_INFO = NO;
227 | SDKROOT = iphoneos;
228 | VALIDATE_PRODUCT = YES;
229 | };
230 | name = Release;
231 | };
232 | 58B511F01A9E6C8500147676 /* Debug */ = {
233 | isa = XCBuildConfiguration;
234 | buildSettings = {
235 | HEADER_SEARCH_PATHS = (
236 | "$(inherited)",
237 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
238 | "$(SRCROOT)/../../../React/**",
239 | "$(SRCROOT)/../../react-native/React/**",
240 | );
241 | LIBRARY_SEARCH_PATHS = "$(inherited)";
242 | OTHER_LDFLAGS = "-ObjC";
243 | PRODUCT_NAME = ColorPickerIos;
244 | SKIP_INSTALL = YES;
245 |
246 | SWIFT_OBJC_BRIDGING_HEADER = "ColorPickerIos-Bridging-Header.h";
247 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
248 | SWIFT_VERSION = 5.0;
249 |
250 | };
251 | name = Debug;
252 | };
253 | 58B511F11A9E6C8500147676 /* Release */ = {
254 | isa = XCBuildConfiguration;
255 | buildSettings = {
256 | HEADER_SEARCH_PATHS = (
257 | "$(inherited)",
258 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
259 | "$(SRCROOT)/../../../React/**",
260 | "$(SRCROOT)/../../react-native/React/**",
261 | );
262 | LIBRARY_SEARCH_PATHS = "$(inherited)";
263 | OTHER_LDFLAGS = "-ObjC";
264 | PRODUCT_NAME = ColorPickerIos;
265 | SKIP_INSTALL = YES;
266 |
267 | SWIFT_OBJC_BRIDGING_HEADER = "ColorPickerIos-Bridging-Header.h";
268 | SWIFT_VERSION = 5.0;
269 |
270 | };
271 | name = Release;
272 | };
273 | /* End XCBuildConfiguration section */
274 |
275 | /* Begin XCConfigurationList section */
276 | 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "ColorPickerIos" */ = {
277 | isa = XCConfigurationList;
278 | buildConfigurations = (
279 | 58B511ED1A9E6C8500147676 /* Debug */,
280 | 58B511EE1A9E6C8500147676 /* Release */,
281 | );
282 | defaultConfigurationIsVisible = 0;
283 | defaultConfigurationName = Release;
284 | };
285 | 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "ColorPickerIos" */ = {
286 | isa = XCConfigurationList;
287 | buildConfigurations = (
288 | 58B511F01A9E6C8500147676 /* Debug */,
289 | 58B511F11A9E6C8500147676 /* Release */,
290 | );
291 | defaultConfigurationIsVisible = 0;
292 | defaultConfigurationName = Release;
293 | };
294 | /* End XCConfigurationList section */
295 | };
296 | rootObject = 58B511D31A9E6C8500147676 /* Project object */;
297 | }
298 |
--------------------------------------------------------------------------------