Socket
Socket
Sign inDemoInstall

react-native-material-palette

Package Overview
Dependencies
3
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-material-palette

>


Version published
Maintainers
1
Install size
34.5 MB
Created

Readme

Source

react-native-material-palette

npm version CircleCI Coverage Status

Android Palette API brought to react native. It extracts prominent colors from images to help you create visually engaging apps. At the moment it only supports Android.

Installation

Installation and setup guide can be found here: Setup guide.

Usage with createMaterialPalette

import { createMaterialPalette } from "react-native-material-palette";

const palette = await createMaterialPalette({ uri: 'http://dummySite/images/yummy.jpg' });

Usage with MaterialPaletteProvider and withMaterialPalette

import { MaterialPaletteProvider, withMaterialPalette } from 'react-native-material-palette';

const PaletteView = withMaterialPalette(
  palette => ({ backgroundColor: palette.vibrant.color }),
)(View);

// later ...

<MaterialPaletteProvider
  image={require('../assets/image.png')}
  options={{
    type: 'vibrant',
  }}
  defaults={{
    vibrant: {
      color: '#3792dd',
      bodyTextColor: '#ffffff',
      titleTextColor: '#ffffff',
    },
  }}
>
  <PaletteView style={{ flex: 1 }}>
    <Text>Hello World</Text>
  </PaletteView>
</MaterialPaletteProvider>

API

Full API documentation can be found here: API documentation.

Future work

  • iOS support
  • Providing own color profiles

Example app

The repo includes an example app that covers all the API cases. Go here to try it out!

image

image

Development

Development instructions can be found here: react-native-material-palette development.

License

MIT

FAQs

Last updated on 21 Aug 2017

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc