Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
react-native-color-palette
Advanced tools
Readme
A react native module for simple hex color selection
Install the color picker
npm install react-native-color-palette --save
import ColorPalette from 'react-native-color-palette'
const UncontrolledColorPicker = () => (
<ColorPalette
onChange={color => alert(`Color selected: ${color}`)}
defaultColor={'#C0392B'}
colors={['#C0392B', '#E74C3C', '#9B59B6', '#8E44AD', '#2980B9']}
title={"Uncontrolled Color Palette:"}
icon={
<Text>✔</Text>︎
// Icon can just be text or ASCII
}
/>
)
const ControlledColorPicker = () => {
let selectedColor = '#C0392B';
return (
<ColorPalette
onChange={color => selectedColor = color}
value={selectedColor}
colors={['#C0392B', '#E74C3C', '#9B59B6', '#8E44AD', '#2980B9']}
title={"Controlled Color Palette:"}
icon={
<Icon name={'check-circle-o'} size={25} color={'black'} />
// React-Native-Vector-Icons Example
}
/>)
}
Due to its Flexbox design, Color Palette will use the space you provide!
Color Palette accepts properties below.
Property | Type | Note |
---|---|---|
colors | Array | Array of hex color strings for rendering. ex) ['#C0392B', '#E74C3C', '#9B59B6', '#8E44AD', '#2980B9'] |
defaultColor | String | Defines initial selected color in uncontrolled component. |
value | String | Defines selected color in controlled component. |
paletteStyles | ViewStyle | Styles passed to color palette container |
onChange | Function | Callback with color (HEX string) as argument called when user confirms color selection. |
title | String | Text to display at the top of the palette. |
titleStyles | TextStyle | Inherits the default react-native Text Styles |
icon | Text or Icon | Selector Text or Icon to be displayed in place of checkmark. |
scaleToWindow | Bool | This will automatically scale the palette to fit 6 per line and will scale up/down for iPads/ iPhones depending on window size |
FAQs
A react native module for simple hex color selection
The npm package react-native-color-palette receives a total of 243 weekly downloads. As such, react-native-color-palette popularity was classified as not popular.
We found that react-native-color-palette demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.