{"id":13776838,"url":"https://github.com/chetstone/react-native-palette","last_synced_at":"2026-03-07T08:03:29.869Z","repository":{"id":15098591,"uuid":"77559296","full_name":"chetstone/react-native-palette","owner":"chetstone","description":"A library wrapping the Android Palette class to extract colors from an image.","archived":false,"fork":false,"pushed_at":"2025-12-15T03:54:16.000Z","size":981,"stargazers_count":75,"open_issues_count":7,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-17T22:17:13.070Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chetstone.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-12-28T20:26:01.000Z","updated_at":"2025-12-15T03:54:20.000Z","dependencies_parsed_at":"2024-01-13T07:33:18.742Z","dependency_job_id":"f0cba1de-e9d8-4bb2-96d1-de55b9a5864b","html_url":"https://github.com/chetstone/react-native-palette","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/chetstone/react-native-palette","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chetstone%2Freact-native-palette","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chetstone%2Freact-native-palette/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chetstone%2Freact-native-palette/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chetstone%2Freact-native-palette/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chetstone","download_url":"https://codeload.github.com/chetstone/react-native-palette/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chetstone%2Freact-native-palette/sbom","scorecard":{"id":277091,"data":{"date":"2025-08-11","repo":{"name":"github.com/chetstone/react-native-palette","commit":"4060e0709b5bc9afafaf0a8c5e35f9749d574c13"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.6,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 1/12 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: example/android/gradle/wrapper/gradle-wrapper.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: ISC License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 20 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"48 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-22h7-7wwg-qmgg","Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp","Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-f5x2-xv93-4p23","Warn: Project is vulnerable to: GHSA-gmpm-xp43-f7g6","Warn: Project is vulnerable to: GHSA-pf27-929j-9pmm","Warn: Project is vulnerable to: GHSA-327c-qx3v-h673","Warn: Project is vulnerable to: GHSA-x4cf-6jr3-3qvp","Warn: Project is vulnerable to: GHSA-mph8-6787-r8hw","Warn: Project is vulnerable to: GHSA-7mhc-prgv-r3q4","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-v8v8-6859-qxm4","Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-w7rc-rwvf-8q5r","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-rxrc-rgv4-jpvx","Warn: Project is vulnerable to: GHSA-7f53-fmmv-mfjv","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-fhg7-m89q-25r3","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T14:46:16.777Z","repository_id":15098591,"created_at":"2025-08-17T14:46:16.777Z","updated_at":"2025-08-17T14:46:16.777Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30209797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T05:23:27.321Z","status":"ssl_error","status_checked_at":"2026-03-07T05:00:17.256Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-08-03T18:00:33.807Z","updated_at":"2026-03-07T08:03:29.844Z","avatar_url":"https://github.com/chetstone.png","language":"JavaScript","funding_links":[],"categories":["\u003ca name=\"Image-\u0026-Audio-\u0026-Video-\u0026-Docs:-Native-Modules\"\u003eImage, Audio, Video \u0026 Docs: Native Modules\u003c/a\u003e"],"sub_categories":[],"readme":"# react-native-palette\n\nA React-Native library which extracts prominent colors from an image. On Android, it wraps the [Android Pallete Class](https://developer.android.com/reference/android/support/v7/graphics/Palette.html). On iOS, it uses code from [react-native-color-grabber](https://github.com/bsudekum/react-native-color-grabber).\n\n An example app is included.\n\n## Getting started\n\n`$ npm install react-native-palette --save`\n\nor\n\n`yarn add react-native-palette`\n\n## For use on React-Native \u003e= 0.60.0\n\nUse version \u003e= 1.0.0 of this package, which supports autolinking. No further installation steps are required.\n\n## For use on React-Native \u003c 0.60.0\n\nUse version 0.4.x of this package and follow linking steps below:\n\n### Mostly automatic installation for Android and iOS\n\n`$ react-native link react-native-palette`\n\n\n### Manual installation\n\n#### Android\n\n1. Open up `android/app/src/main/java/[...]/MainApplication.java`\n  - Add `import io.palette.RNPalettePackage;` to the imports at the top of the file\n  - Add `new RNPalettePackage()` to the list returned by the `getPackages()` method\n2. Append the following lines to `android/settings.gradle`:\n\n  ```\n   include ':react-native-palette'\n   project(':react-native-palette').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-palette/android')\n  ```\n3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:\n```\n   compile project(':react-native-palette')\n```\n\n\n#### iOS\n\n1. Add `node_modules/react-native-palette/ios/RNPalette.xcodeproj` to your Xcode project\n\n## API\n\n### `getAllSwatches(options, image, (error, swatches) =\u003e {})`\n\n#### options\nAn object containing option properties.\nThese properties are valid for iOS only. On Android, this parameter is ignored.\n\nProperty | Type | Info\n-------- | ---- | ----\n`threshold` | Float | Determines whether white or black text will be selected to contrast with the selected color. It is the value for `L`, in the complex formula at the end of this [StackOverflow comment](http://stackoverflow.com/a/3943023/1404185). The default value is 0.179.\n`quality` | String | One of \"low\", \"medium\", or \"high\". Higher quality extracts more colors, takes more time and consumes more memory. Default is \"low\".\n`alpha` | Float | From 0 to 1. Determine alpha of hex property. Default is 1. This value is multiplied by the alpha returned from the underlying platform-specific code. It does not affect the alpha of the `color` (rgba), `titleTextColor`, or `bodyTextColor` fields.\n\n#### image\nA path to an image such as that returned by [`react-native-image-picker`](https://github.com/marcshilling/react-native-image-picker). For iOS use the `origURL` field of the image picker response for images from `assets-library://`. For Android use the `path` field. Also for IOS, you can use a local URI, such as that returned by `RNFS.LibraryDirectoryPath` in the [react-native-fs](https://github.com/itinance/react-native-fs/) library.\n\nFor versions of [`react-native-image-picker`](https://github.com/marcshilling/react-native-image-picker) \u003e= 3.0.0, use `response.assets[0].uri.slice(7)`\n\n\n#### callback\nThe callback is passed an error parameter and an array of swatches representing the dominant colors in the image. Typically 16 swatches are returned on Android, fewer on iOS.\n\n### `getNamedSwatches(image, (error, swatches) =\u003e {})`\n\nAndroid only.\n\n#### image\n\nSame as in `getAllSwatches`\n\n#### swatches\n\nAn object keyed by the qualities of colors defined by the Android `Palette` Class.\nThe keys are the following:\n\n* \"Vibrant\"\n* \"Vibrant Dark\"\n* \"Vibrant Light\"\n* \"Muted\"\n* \"Muted Dark\"\n* \"Muted Light\"\n\nThe values are swatches (possibly `null`) or with the fields defined below.\n\n\n### Swatch Fields\n\nColors include alpha in the `react-native`  `rgba(255,255,255,1.0)` format. Note that on iOS10 devices UIExtendedSRGBColorSpace color values may be greater than 255 or less than 0, but they will render correctly on the device.\n\nField | Info\n------ | ----\ncolor | The main color of the swatch.\npopulation | The dominance of this swatch in the image. You can sort on this field to find the most dominant swatch. Android: A positive integer. iOS: A floating point number between 0 and 1.\ntitleTextColor | A text color which contrasts well with the main swatch color for use in titles.\nbodyTextColor | A text color which contrasts well with the main swatch color for use as body text.\nswatchInfo | A string encapsulating all the above and more. Can be used for debugging. Android: Note that the hex strings are in the format `#aarrggbb` rather than the `react-native` format. iOS: the result string returned by the old (`react-native-color-grabber`) API.\nhex | Hex code, computed from color, in format `#rrggbbaa` .\n\n### Example\n```javascript\n\n  import {getAllSwatches} from 'react-native-palette';\n  import ImagePicker from 'react-native-image-picker'\n\n  ImagePicker.launchImageLibrary({}, (response)  =\u003e {\n    var path =  Platform.OS === 'ios' ? response.origURL : response.path;\n    getAllSwatches({}, path, (error, swatches) =\u003e {\n      if (error) {\n        console.log(error);\n      } else {\n        swatches.sort((a, b) =\u003e {\n          return b.population - a.population;\n        });\n        swatches.forEach((swatch) =\u003e {\n          console.log(swatch.swatchInfo);\n        });\n      }\n    });\n  });\n```\n## Contributing\n\nThanks for your interest in improving `react-native-palette`. Please review the following requests before submitting your PR.\n\n1. Test your change with the example app. The README file in the example directory explains an easy way to build and run it.\n4. If you're adding a new feature, please add something in the example app to demonstrate it.\n5. Please keep your changes concise and avoid unnecessary formatting/indentation changes. They make the diff difficult to understand and review. If you have an new idea for formatting that will save the world, by all means propose it, but at least include a `prettier` spec for automating it. This goes double for Java/Objective-C changes, since those are foreign languages to me.\n1. In your PR, please give a brief explanation of the purpose, referencing Issues when appropriate, and mention whether your change will require a patch, minor or major semver bump.\n6. Please document your changes in CHANGELOG.md.\n\nThanks again.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchetstone%2Freact-native-palette","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchetstone%2Freact-native-palette","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchetstone%2Freact-native-palette/lists"}