Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-color

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-color - npm Package Compare versions

Comparing version 2.0.7 to 2.0.8

2

config/prod.env.js
module.exports = {
NODE_ENV: '"production"'
NODE_ENV: 'production'
}
{
"name": "vue-color",
"version": "2.0.7",
"version": "2.0.8",
"description": "Color of Vue Components",

@@ -5,0 +5,0 @@ "keywords": [

@@ -103,3 +103,2 @@ # vue-color

<material-picker v-model="colors" @change-color="onChange"></material-picker>
<material-picker v-model="colors" @change-color="onChange"></material-picker>
<compact-picker v-model="colors" @change-color="onChange"></compact-picker>

@@ -106,0 +105,0 @@ <swatches-picker v-model="colors" @change-color="onChange"></swatches-picker>

import tinycolor from 'tinycolor2'
function _colorChange (data, oldHue) {
if (data.a && data.a > 1) {
data.a = 1
}
var alpha = data && data.a
var color
data.a = data.a || 1
var color
if (data.hex) {
// hsl is better than hex between conversions
if (data && data.hsl) {
color = tinycolor(data.hsl)
} else if (data && data.hex && data.hex.length > 0) {
color = tinycolor(data.hex)
color.setAlpha(data.a)
} else {
color = tinycolor(data)
}
if (color) color.setAlpha(alpha || 1)
var hsl = color.toHsl()
var hsv = color.toHsv()
if (hsl.s === 0) {

@@ -23,2 +25,3 @@ hsl.h = data.h || oldHue || 0

}
return {

@@ -31,3 +34,3 @@ hsl: hsl,

source: data.source,
a: data.a
a: data.a || color.getAlpha()
}

@@ -57,19 +60,8 @@ }

this.val = _colorChange(newVal)
// this.$emit('change', newVal)
}
},
created () {
// console.log(this.colors)
/*
Enforce the colorChange in case only HEX value is given.
Guarantees that HEX value is uppercase and other values such
as HSL or HSV exists and reflect the HEX value
TODO accept any kind of color value, HEX, RGBA, HSL and others
*/
// this.colors = _colorChange(this.colors)
},
methods: {
colorChange (data, oldHue) {
this.oldHue = this.colors.hsl.h
this.colors = _colorChange(data, oldHue || this.oldHue)
this.oldHue = this.colors.hsl.h
},

@@ -76,0 +68,0 @@ isValidHex (hex) {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc