npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-color-picker-palette

v1.0.3

Published

A versatile color picker for React Native with two flavors: Full (with react-native-svg) and Lite (zero dependencies)

Readme

React Native Color Palette

A versatile, customizable color picker for React Native with two flavors:

  • Full Version: Uses react-native-svg for smooth gradients and precise rendering
  • Lite Version: Zero external dependencies, uses pure React Native Views

Features

  • Circular color wheel (hue + saturation)
  • Rectangle saturation/value picker
  • Hue slider bar
  • Alpha slider with checkerboard background
  • Value/Brightness slider
  • HEX and RGB input fields
  • Fully customizable (size, colors, visibility)
  • TypeScript support
  • iOS and Android compatible

Installation

# Using npm
npm install react-native-color-picker-palette

# Using yarn
yarn add react-native-color-picker-palette

Full Version (with react-native-svg)

If you want to use the full version with smooth SVG gradients:

npm install react-native-svg
cd ios && pod install

Lite Version (zero dependencies)

The lite version works out of the box - no additional dependencies needed!

Usage

Basic Usage (Full Version)

import React from 'react';
import { View } from 'react-native';
import { ColorPicker, useColor } from 'react-native-color-picker-palette';

function MyColorPicker() {
  const [color, setColor] = useColor('#FF0000');

  return (
    <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
      <ColorPicker
        color={color}
        onChange={setColor}
        onChangeComplete={(c) => console.log('Selected:', c.hex)}
      />
    </View>
  );
}

Lite Version (Zero Dependencies)

import React from 'react';
import { View } from 'react-native';
import { ColorPicker, useColor } from 'react-native-color-picker-palette/lite';

function MyColorPicker() {
  const [color, setColor] = useColor('#FF0000');

  return (
    <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
      <ColorPicker
        color={color}
        onChange={setColor}
        onChangeComplete={(c) => console.log('Selected:', c.hex)}
      />
    </View>
  );
}

Picker Variants

Rectangle Variant (default)

<ColorPicker variant="rectangle" ... />
  • Saturation/Value rectangle with current hue
  • Hue slider is always visible (required to change hue)
  • Value slider is NOT shown (value is controlled in the rectangle)

Circle Variant

<ColorPicker variant="circle" ... />
  • Color wheel with hue around the circle and saturation from center
  • Value/Brightness slider is shown (to control brightness)
  • hideHue prop works to hide the hue slider

API Reference

ColorPicker Props

| Prop | Type | Default | Variant | Description | |------|------|---------|---------|-------------| | color | IColor | required | Both | Current color value | | onChange | (color: IColor) => void | required | Both | Called on every color change during interaction | | onChangeComplete | (color: IColor) => void | - | Both | Called when interaction ends (finger lifted) | | variant | 'circle' \| 'rectangle' | 'rectangle' | - | Picker variant | | width | number | 250 | Both | Width of the picker (diameter for circle) | | barHeight | number | 10 | Both | Height of slider bars | | thumbSize | number | 24 | Both | Size of thumb indicators | | hideHue | boolean | false | Circle only | Hide the hue slider (ignored for rectangle) | | hideAlpha | boolean | false | Both | Hide the alpha slider | | hidePreview | boolean | false | Both | Hide the color preview | | hideInput | boolean | false | Both | Hide the input fields | | disabled | boolean | false | Both | Disable all interactions |

Variant-Specific Behavior

| Feature | Rectangle | Circle | |---------|-----------|--------| | Hue selection | Via Hue slider (always shown) | Via color wheel angle | | Saturation selection | X-axis of rectangle | Distance from center | | Value/Brightness selection | Y-axis of rectangle | Via Value slider | | Hue slider | Always visible | Optional (use hideHue) | | Value slider | Not shown | Always shown |

IColor Type

interface IColor {
  hex: string;      // e.g., "#FF0000" or "#FF0000FF" with alpha
  rgb: IRGB;
  hsv: IHSV;
}

interface IRGB {
  r: number;  // 0-255
  g: number;  // 0-255
  b: number;  // 0-255
  a: number;  // 0-1
}

interface IHSV {
  h: number;  // 0-360
  s: number;  // 0-100
  v: number;  // 0-100
  a: number;  // 0-1
}

Hooks

useColor

const [color, setColor] = useColor('#FF0000');

Manages color state with automatic conversion from hex string.

useColorWithCallback

const {
  color,
  setColor,
  handleChange,
  handleChangeComplete,
} = useColorWithCallback('#FF0000', (color) => {
  console.log('Color changed:', color.hex);
});

Manages color state with a callback for change completion.

ColorService

Utility for color conversions:

import { ColorService } from 'react-native-color-picker-palette';

// Create color from hex
const color = ColorService.fromHex('#FF5500');

// Create color from RGB
const color = ColorService.fromRgb({ r: 255, g: 85, b: 0, a: 1 });

// Create color from HSV
const color = ColorService.fromHsv({ h: 20, s: 100, v: 100, a: 1 });

// Get string representations
ColorService.toRgbString(color.rgb);   // "rgb(255, 85, 0)"
ColorService.toRgbaString(color.rgb);  // "rgba(255, 85, 0, 1)"
ColorService.toHslString(color.hsv);   // "hsl(20, 100%, 50%)"

Individual Components

For custom layouts, you can use individual components:

import {
  Saturation,           // Circular color wheel (for circle variant)
  RectangleSaturation,  // Rectangle saturation/value picker
  Hue,                  // Hue slider
  Alpha,                // Alpha slider
  Value,                // Brightness slider (for circle variant)
  Fields,               // HEX + RGB inputs
  HexField,             // HEX input only
  RgbFields,            // RGB inputs only
  Thumb,                // Thumb indicator
} from 'react-native-color-picker-palette';

Example: Custom Layout

import React from 'react';
import { View } from 'react-native';
import {
  RectangleSaturation,
  Hue,
  Alpha,
  useColor,
} from 'react-native-color-picker-palette';

function CustomColorPicker() {
  const [color, setColor] = useColor('#FF0000');

  return (
    <View style={{ padding: 20 }}>
      <RectangleSaturation
        color={color}
        onChange={setColor}
        width={300}
        height={200}
        thumbSize={28}
      />
      <View style={{ height: 20 }} />
      <Hue
        color={color}
        onChange={setColor}
        barHeight={12}
        thumbSize={24}
      />
      <View style={{ height: 10 }} />
      <Alpha
        color={color}
        onChange={setColor}
        barHeight={12}
        thumbSize={24}
      />
    </View>
  );
}

Full vs Lite: When to Use Which?

Use Full Version When:

  • You need the smoothest possible gradients
  • You're already using react-native-svg in your project
  • Visual quality is the top priority

Use Lite Version When:

  • You want zero additional dependencies
  • You're using Expo and want to avoid native modules
  • Bundle size is a concern
  • You need a quick setup without pod install

Screenshots

Full Version (with react-native-svg)

| Rectangle | Circle | |:---------:|:------:| | | |

Lite Version (zero dependencies)

| Rectangle | Circle | |:---------:|:------:| | | |

TypeScript Support

This package is written in TypeScript and includes full type definitions:

import type {
  IColor,
  IRGB,
  IHSV,
  ColorModel,
  IColorPickerProps,
  ISaturationProps,
  IRectangleSaturationProps,
  IHueProps,
  IAlphaProps,
  IValueProps,
  IThumbProps,
  IFieldsProps,
  ILayout,
} from 'react-native-color-picker-palette';

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see the LICENSE file for details.

Author

Sabri Ghazali


Made with React Native