Coder Social home page Coder Social logo

vue-pick-colors's Introduction

🎉 A Color picker for Vue.js 3

🇨🇳中文版


Installation

npm install vue-pick-colors

or

yarn add vue-pick-colors

Usage

<template>
  <pick-colors v-model:value="value" show-alpha/>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue'
import PickColors from 'vue-pick-colors'
export default defineComponent({
  name: 'App',
  components: {
    PickColors
  },
  setup () {
    const value = ref('#00cedf')
    return {
      value
    }
  }
})
</script>

API

Property Description Type Default
value(v-model) binding value
support hex、rgb、rgba、hsl、hsla
string | string[]
format color format hex | rgb | hsl hex
show-alpha whether to display the alpha slider boolean false
size color block size number 20
theme component theme light | dark light
colors predefined color options
support hex、rgb、rgba、hsl、hsla
string [] ['#ff4500','#ff8c00','#ffd700',
'#90ee90','#00ced1','#1e90ff',
'#c71585','#ff4500','#ff7800',
'#00babd','#1f93ff','#fa64c3']
add-color support for adding colors boolean false
max maximum number of colors to add number 13

Events

Events Name Description Arguments
change color value change function(value: string|string [],color: string,index: number)
overflow-max color added to max

vue-pick-colors's People

Contributors

qiuzongyuan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.