Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
reanimated-color-picker
Advanced tools
:red_circle: :green_circle: :large_blue_circle:
:one: Prerequisites
:two: Installation
:three: Usage
:four: API
:five: Example
:six: License
Use the links below to follow the installation instructions.
react-native-gesture-handler version 2.0.0
or higher.
react-native-reanimated version 2.0.0
or higher.
For Expo
manged workflow version 44
or higher is required.
Note First we need to install react-native-gesture-handler(>=2.0.0) and react-native-reanimated(>=2.0.0),
npm i reanimated-color-picker
You can add, remove, rearrange or style the color picker's built-in components.
You can also add your components.
Check out the working examples:
import React, { useState } from 'react';
import { Button, Modal, View } from 'react-native';
import ColorPicker, { Panel1, Swatches, Preview, OpacitySlider, HueSlider } from 'reanimated-color-picker';
export default function App() {
const [showModal, setShowModal] = useState(false);
const onSelectColor = ({ hex }) => {
// do something with the selected color
console.log(hex);
};
return (
<View style={styles.container}>
<Button title='Color Picker' onPress={() => setShowModal1(true)} />
<Modal visible={showModal}>
<ColorPicker value='red' onComplete={onSelectColor}>
<Preview />
<Panel1 />
<HueSlider />
<OpacitySlider />
<Swatches />
</ColorPicker>
<Button title='Ok' onPress={() => setShowModal(false)} />
</Modal>
</View>
);
}
The ColorPicker
Wrapper is responsible for managing the built-in components.
It has the following props:
'hex'
, 'rgb'
, 'rgba'
, 'hsl'
, 'hsla'
and named color
formats.type: string
default: '#418181'
vertical
orientation and height in horizontal
orientation.type: number
default: 25
type: number
default: 35
width
property.type: object
Note some style properties will be overwritten.
hex
, rgb
, rgba
, hsl
and hsla
type: (color: object) => void
default: null
hex
, rgb
, rgba
, hsl
and hsla
type: (color: object) => void
default: null
<Preview />
Property | Type | Default | Description |
---|---|---|---|
colorFormat | string | 'hex' | preview color text format: 'hex' , 'rgb' , 'rgba' , 'hsl' , 'hsla' , 'hsv' or 'hsva' |
hideInitialColor | boolean | false | hide the initial color preview part |
hideText | boolean | false | hide preview color text |
style | object | / | preview container style |
textStyle | object | / | preview text style |
Note some style properties will be overwritten.
<Panel1 />
Note you need to add
<HueSlider />
alongside with it.
Property | Type | Default | Description |
---|---|---|---|
thumbSize | number | 35 | panel handle (thumb) size (height*width) |
style | object | / | panle container style |
Note some style properties will be overwritten.
<Panel2 />
Note you need to add
<BrightnessSlider />
alongside with it.
Property | Type | Default | Description |
---|---|---|---|
thumbSize | number | 35 | panel handle (thumb) size (height*width) |
style | object | / | panle container style |
Note some style properties will be overwritten.
<HueSlider />
Property | Type | Default | Description |
---|---|---|---|
thumbSize | number | 35 | hue slider handle (thumb) size (height*width) |
ringColor | string | #fff | the color of the ring around the slider handle |
reverse | boolean | false | reverse slider direction |
vertical | boolean | false | change slider orientation |
style | object | / | hue slider container style |
Note some style properties will be overwritten.
<SaturationSlider />
Property | Type | Default | Description |
---|---|---|---|
thumbSize | number | 35 | saturation slider handle (thumb) size (height*width) |
ringColor | string | #fff | the color of the ring around the slider handle |
reverse | boolean | false | reverse slider direction |
vertical | boolean | false | change slider orientation |
style | object | / | saturation slider container style |
Note some style properties will be overwritten.
<BrightnessSlider />
Property | Type | Default | Description |
---|---|---|---|
thumbSize | number | 35 | brightness slider handle (thumb) size (height*width) |
ringColor | string | #fff | the color of the ring around the slider handle |
reverse | boolean | false | reverse slider direction |
vertical | boolean | false | change slider orientation |
style | object | / | brightness slider container style |
Note some style properties will be overwritten.
<OpacitySlider />
Property | Type | Default | Description |
---|---|---|---|
thumbSize | number | 35 | opacity slider handle (thumb) size (height*width) |
ringColor | string | #fff | the color of the ring around the slider handle |
reverse | boolean | false | reverse slider direction |
vertical | boolean | false | change slider orientation |
style | object | / | opacity slider container style |
Note some style properties will be overwritten.
<Swatches />
Property | Type | Default | Description |
---|---|---|---|
colors | string[ ] | material colors | custom swatches colors |
style | object | / | swatches container style |
swatchStyle | object | / | swatch style |
Note some style properties will be overwritten.
FAQs
A Pure JavaScript Color Picker for React Native
The npm package reanimated-color-picker receives a total of 12,430 weekly downloads. As such, reanimated-color-picker popularity was classified as popular.
We found that reanimated-color-picker demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.