A Vue color picker component based on the Farbtastic jQuery Color Picker plug-in

Overview

Vue Color Picker Wheel

Example

Version Downloads License

A Vue color picker component based on the Farbtastic jQuery Color Picker plug-in.

Demo

Basic

Basic CodePen demo

Installation

npm install --save vue-color-picker-wheel

Usage

ES6 modules

<template>
    <div id="app">
        <color-picker v-model="color"></color-picker>
        <p>
            Color:
            <input v-model="color" type="text">
        </p>
    </div>
</template>
<script>
    import ColorPicker from 'vue-color-picker-wheel';

    export default {
        name: 'App',
        components: {
            ColorPicker
        },
        created() {
        },
        data() {
            return {
                color: '#ffffff'
            };
        },
    };
</script>

CommonJS

const ColorPicker = require('vue-color-picker-wheel');

In a script tag, this loads the component using the global Vue instance.

<script src="https://unpkg.com/vue-color-picker-wheel"></script>

Properties

Property Description Type Default Example
width The width of the color picker Number 300 :width="400"
height The height of the color picker Number 300 :height="400"
disabled Whether or not the color picker should be disabled Boolean false :disabled="false"
v-model v-model to create two-way data binding for color String (hex color code) none v-model="color"
startColor The color that is selected when opening the colorpicker String (hex color code) none startColor="#ffffff"

Events

Event Description Event parameters
color-change Is fired after the selected color has changed color: String (hex color code)

Contributing

Checkout GitHub issues for any issues we need some help with.

# Serve with hot reload (default at localhost:8080)
vue serve --open src/color-picker.vue

# Build all variants
npm run build

Changelog

Changelog on Github

License

MIT

Comments
  • How to use color-change

    How to use color-change

    I tried to use color-change event listener and I don't see the color value:

    <template>
      <ColorPicker
        :color-change="setHex"
        :startColor="finalSettings.button_color"
        v-model="finalSettings.button_color" />
    </template>
    <script>
    import ColorPicker from 'vue-color-picker-wheel';
    
    export default {
            components: {
                ColorPicker,
            },
            props: {
                ...
            },
            data: function () {
                return {
                    finalSettings: this.settings,
                    color: this.settings.button_color,
                }
            },
            methods: {
                setHex: function(colorPalette) {
                    console.log(colorPalette); // <- the console didn't display this.
                    this.color = colorPalette;
                },
            }
       }
    </script>
    
    opened by diegohdez90 2
  • Color selection failing when browser window is scrolled

    Color selection failing when browser window is scrolled

    I found that the color picker was not following my mouse clicks correctly. I tracked the problem down to widgetCoords(event), which was returning incorrect co-ordinates when the browser window was scrolled away from the start position. Suggested solution: replace all instances of pageX and pageY with clientX and clientY.

    bug 
    opened by gpandrew 2
  • Bug color selection in scrolled window

    Bug color selection in scrolled window

    Fixes https://github.com/stijlbreuk/vue-color-picker-wheel/issues/9 by using clientX and clientY properties to determine where the user clicked or touched.

    opened by nino-vrijman 0
  • Bug i5 text align changes position

    Bug i5 text align changes position

    Fixes https://github.com/stijlbreuk/vue-color-picker-wheel/issues/5 by setting the absolute position on the canvas element with the colored ring and gradient and the canvas element with the circular markers.

    opened by nino-vrijman 0
  • Bug #6 color change event

    Bug #6 color change event

    Solves https://github.com/stijlbreuk/vue-color-picker-wheel/issues/6 Using 'colorChange' will be deprecated in 0.4.0 and will be removed in 1.0.0. Use 'v-model' or the 'color-change' event instead.

    opened by nino-vrijman 0
  • Implements v-model for color

    Implements v-model for color

    The question is what to do with startColor and colorChange, as they are a bit redundant now. Also codepen and codesandbox have to be updated after merge

    opened by peerbolte 0
Owner
Stijlbreuk
Digital Agency
Stijlbreuk
A Vue3.x based color picker component with gradient bar control.

a Vue3.x based color picker component. English | 中文 Features Supports 3 CSS background color modes: solid, linear-gradient and radial-gradient. Suppor

null 7 Dec 3, 2022
:art: Vue Color Pickers for Sketch, Photoshop, Chrome & more http://vue-color.surge.sh

vue-color Color Pickers for Sketch, Photoshop, Chrome & more with Vue.js(vue2.0). Live demo Installation NPM $ npm install vue-color CommonJS var Phot

Don 2.4k Dec 29, 2022
🎨 A natural color picker component for Vue.js

Color picker for Vue.js A Vue.js color picker component designed for humans. Installation npm i --save-dev vue-color-picker-board Browser Include the

Shlomi Nissan 11 Nov 24, 2022
🎨 A Color picker component. Built from the bottom to work with Vue.js.

Verte A Complete Vue.js Color Picker Component Features Multiple Color Models support: RGB, HSL, and HEX. SSR Friendly. Small file size, only 7kb gzip

Baianat 159 Dec 26, 2022
Accessible color picker component for Vue.js

vue-accessible-color-picker An accessible Vue.js color picker component. Links: demo npmjs.com/package/vue-accessible-color-picker on BundlePhobia git

Philipp Rudloff 69 Dec 28, 2022
A color picker vue component

A color picker vue component

Benny Schudel 0 Feb 8, 2021
Color picker Vue.js component

vue-colorpicker Color picker Vue.js component.

Jamena McInteer 3 Jul 13, 2018
Radial Color Picker - Vue

Radial Color Picker - Vue Introduction Great UX starts with two basic principles - ease of use and simplicity. Selecting a color should be as easy as

Radial Color Picker 83 Dec 28, 2022
🎨 Lightweight color picker for Vue 3

?? Lightweight color picker for Vue 3

Anish George 141 Jan 2, 2023
A Nice Color Gradient Picker with Vue

Vue Color Gradient Picker Table of Contents Installation Examples Demos Installation To install, you can use npm or yarn: $ npm install vue-color-grad

Arthur Hayrapetyan 42 Dec 14, 2022
Color picker for vue using Tailwind v2

Vue Tailwind Color Picker Color picker for vue using Tailwind v2. Requires Tailwind Live demo Installation $ npm install vue-tailwind-color-picker $ y

null 15 Jun 21, 2022
Cordelia Vue - a VueJS plugin that allows you to add a rich color picker into your web pages

Color picker for web and mobile browsers. Vue plugin version of Cordelia Color Picker library.

Cevad Tokatlı 2 Aug 29, 2018
Vue color picker

Vue color picker Iro color picker for Vue. Demo See demo here Install npm install vue-iro-color-picker --save Usage import ColorPicker from 'vue-iro-

iro.js 10 Sep 6, 2021
Color Picker app, created by tauri.

Color Picker 取色器 ✨ 特性 一键取色并复制到剪贴板 保留历史取色记录 自定义颜色值类型(如:HEX, RGB 等) 自定义取色快捷键(默认:F2) 颜色值去重 历史记录:左键单击显示颜色值,左键双击复制颜色值到剪贴板,右键单击删除颜色 可隐藏界面取色 软件安装包小,占用内存少 ??

Hunlongyu 27 Sep 30, 2022
Color picker chrome-style only

one-colorpicker A Chrome-style ColorPicker Install $ npm install one-colorpicker Quick Start import {ColorPicker, ColorPanel} from 'one-colorpicker'

null 13 Sep 20, 2022
Color Picker base on Vue2.x

Color Picker base on Vue2.x

阿多 2 Nov 15, 2020
Vue component to pick a color from a base64 image, by clicking on it

vue-img-color-picker Vue component to pick a color from a base64 image, by clicking on it. You can access the selected color by $refs.colorPicker.colo

Gecco Media GmbH 0 Oct 29, 2022
A color input component for Vuetify.

VuetifyColorInput A color input component for Vuetify. demo Try it out! dependencies chroma.js setup npm npm i vuetify-color-input import VuetifyColor

Sergej Sintschilin 3 May 20, 2021
(vue3.0) 🎨 Vue Color Pickers for Sketch, Photoshop, Chrome & more

?? Vue Color Pickers for Sketch, Photoshop, Chrome & more

ckpack 106 Dec 28, 2022