1.0.27 • Published 10 months ago

@bayramitto/react-native-colorpicker v1.0.27

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

React Native ColorPicker

A very basic color picker for React Native. Created with Reanimated 2

Description

IMPORTANT! With this picker you can get the HEX/DEC color codes of your selected color, you can set your own color palette and use them wherever you wish.

Preview

ezgif-3-4c9d63a9eb

Note

Make sure you have following packages installed on your project.

npm i react-native-linear-gradient
npm i react-native-reanimated
npm i react-native-gesture-handler

If you alredy have them, you can skip this.

Installation

npm i @bayramitto/react-native-colorpicker 

Usage

import ColorPicker from "@bayramitto/react-native-colorpicker";
const App = () => {
  const [bg, setBg] = useState('#000');

  return (
    <View
      style={{
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: bg,
      }}>
      <ColorPicker
        styles={{
          width: 200,
          height: 15,
          borderRadius: 20,
          borderWidth: 1,
          borderColor: '#fff',
        }}
        onColorChanged={color => {
          setBg(color);
        }}
      />
    </View>
  );
};

Properties

PropDefaultTypeDescription
colors-ArrayYou can define your own color palette in Array of HEX codes eg. "#fa3261","#c9a221"
*style (Required)-objectSpecify the style of the ColorPicker. ( width and height values REQUIRED )
onColorChanging-callbackReturns output format of the interpolateColors from Reanimated 2
*onColorChanged (Required)-callbackReturns hex code of selected color eg. #e5ca55.
circleSize-numberSize of the circle on picker.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

1.0.27

10 months ago

1.0.26

12 months ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.1

2 years ago

1.0.2

2 years ago

1.0.0

2 years ago