Skip to content

A modern collection of Vue 3 color pickers – fast, accessible, and easy to use. πŸ‘‰ https://linx4200.github.io/vue-color/

License

Notifications You must be signed in to change notification settings

linx4200/vue-color

Folders and files

NameName
Last commit message
Last commit date

Latest commit

e7afb3f Β· Nov 17, 2017
Jul 26, 2017
Jul 26, 2017
Nov 17, 2017
Jul 25, 2017
Nov 17, 2017
Apr 30, 2016
Apr 30, 2016
Mar 26, 2017
Apr 20, 2016
Jun 7, 2017
May 3, 2016
Jul 26, 2017
Nov 17, 2017
Nov 17, 2017
Jul 25, 2017

Repository files navigation

vue-color

npm

Color Pickers for Sketch, Photoshop, Chrome & more with Vue.js(vue2.0).

intro

Installation

NPM

$ npm install vue-color

CommonJS

var Photoshop = require('vue-color/src/Photoshop.vue');

new Vue({
  components: {
    'Photoshop': Photoshop
  }
})

ES6

import { Photoshop } from 'vue-color'

new Vue({
  components: {
    'photoshop-picker': Photoshop
  }
})

Browser globals

The dist folder contains vue-color.js and vue-color.min.js with all components exported in the window.VueColor object. These bundles are also available on NPM packages.

<script src="path/to/vue.js"></script>
<script src="path/to/vue-color.min.js"></script>
<script>
  var Photoshop = VueColor.Photoshop
</script>

Local setup

npm install
npm run dev

Usage

var defaultProps = {
  hex: '#194d33',
  hsl: {
    h: 150,
    s: 0.5,
    l: 0.2,
    a: 1
  },
  hsv: {
    h: 150,
    s: 0.66,
    v: 0.30,
    a: 1
  },
  rgba: {
    r: 25,
    g: 77,
    b: 51,
    a: 1
  },
  a: 1
}

new Vue({
  el: '#app',
  components: {
    'material-picker': material,
    'compact-picker': compact,
    'swatches-picker': swatches,
    'slider-picker': slider,
    'sketch-picker': sketch,
    'chrome-picker': chrome,
    'photoshop-picker': photoshop
  },
  data: {
    colors: defaultProps
  }
})
<!-- suppose you have the data 'colors' in your component -->
<material-picker v-model="colors" />
<compact-picker v-model="colors" />
<swatches-picker v-model="colors" />
<slider-picker v-model="colors" />
<sketch-picker v-model="colors" />
<chrome-picker v-model="colors" />
<photoshop-picker v-model="colors" />

OR

<chrome-picker :value="colors" @input="updateValue"></chrome-picker>

TODO

-[] docs -[] more components

License

vue-color is licensed under The MIT License.