New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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 0.0.1 to 0.0.2

.babelrc

26

package.json
{
"name": "vue-color",
"version": "0.0.1",
"version": "0.0.2",
"description": "Color of Vue Components",

@@ -9,14 +9,17 @@ "keywords": [

],
"main": "src/app.js",
"main": "dist/vue-color.min.js",
"scripts": {
"dev": "webpack-dev-server --port 3004 --inline --hot --quiet",
"build": "NODE_ENV=production webpack --progress --hide-modules",
"dist": "webpack --progress --hide-modules --config webpack.build.js && NODE_ENV=production webpack --progress --hide-modules --config webpack.build.min.js"
"dist": "webpack --progress --hide-modules --config webpack.build.js && NODE_ENV=production webpack --progress --hide-modules --config webpack.build.min.js",
"lint": "eslint --ext .js,.vue src"
},
"repository": {
"type": "git",
"url": ""
"url": "https://github.com/xiaokaike/vue-color"
},
"author": "xiaokaike",
"author": "xiaokai <kexiaokai@gmail.com>",
"dependencies": {
"vue": "^1.0.12",
"lodash.throttle": "^4.0.0",
"material-colors": "^1.0.0",

@@ -26,3 +29,2 @@ "tinycolor2": "^1.1.2"

"devDependencies": {
"vue": "^1.0.12",
"babel-core": "^6.1.21",

@@ -32,4 +34,13 @@ "babel-loader": "^6.1.0",

"babel-preset-es2015": "^6.1.18",
"babel-preset-stage-2": "^6.5.0",
"babel-runtime": "^5.8.0",
"css-loader": "^0.21.0",
"eslint": "^2.0.0",
"eslint-config-standard": "^5.1.0",
"eslint-friendly-formatter": "^1.2.2",
"eslint-loader": "^1.3.0",
"eslint-plugin-html": "^1.3.0",
"eslint-plugin-promise": "^1.0.8",
"eslint-plugin-standard": "^1.3.2",
"extract-text-webpack-plugin": "^0.8.2",
"style-loader": "^0.13.0",

@@ -41,6 +52,5 @@ "stylus-loader": "^1.4.0",

"webpack": "^1.12.2",
"webpack-dev-server": "^1.12.0",
"extract-text-webpack-plugin": "^0.8.2"
"webpack-dev-server": "^1.12.0"
},
"license": "MIT"
}

@@ -1,1 +0,4 @@

# vue-color
# vue-color
still on develop

@@ -0,32 +1,12 @@

import Vue from 'vue'
import color from './Color.vue'
import material from './components/Material.vue'
import compact from './components/Compact.vue'
import swatches from './components/Swatches.vue'
Vue.config.debug = true
/* eslint-disable no-new */
new Vue({
el: '#app',
components: {
color,
material,
compact,
swatches
},
data: {
hex: '#333',
rgba: {
r: 51,
g: 51,
b: 51,
a: 1,
},
hsl: {
h: 0,
s: 0,
l: .20,
a: 1,
}
el: '#app',
components: {
color
}
})

@@ -1,5 +0,17 @@

import Color from './Color.vue'
import Compact from './components/Compact.vue'
import Material from './components/Material.vue'
import Slider from './components/Slider.vue'
import Swatches from './components/Swatches.vue'
import Photoshop from './components/Photoshop.vue'
import Sketch from './components/Sketch.vue'
import Chrome from './components/Chrome.vue'
const VueColor = {
Color,
Compact,
Material,
Slider,
Swatches,
Photoshop,
Sketch,
Chrome
}

@@ -6,0 +18,0 @@

import tinycolor from 'tinycolor2'
var rgbaRE = /r|g|b|a/i
var hslRE = /h|s|l/i
export default {
props: {
colors: Object
},
created () {
// console.log(this.colors)
this.colors.hex = this.colors.hex.toUpperCase()
},
methods: {
colorChange (data, type) {
console.log(data, type)
if(type === 'hex'){
if(!this.isValidHex(data)){
return
}
var c = tinycolor(data)
this.hsl = c.toHsl()
this.rgba = c.toRgb()
colorChange (data, oldHue) {
if (data.a && data.a > 1) {
data.a = 1
}
if(rgbaRE.test(type)){
if(!this.simpleCheckForValidColor(this.rgba)){
return
}
var c = tinycolor(this.rgba)
this.hex = c.toHexString()
this.hsl = c.toHsl()
var color = data.hex ? tinycolor(data.hex) : tinycolor(data)
var hsl = color.toHsl()
var hsv = color.toHsv()
if (hsl.s === 0) {
hsl.h = oldHue || 0
hsv.h = oldHue || 0
}
if(hslRE.test(type)){
if(!this.simpleCheckForValidColor(this.hsl)){
return
}
var c = tinycolor(this.hsl)
this.hex = c.toHexString()
this.rgba = c.toRgb()
this.colors = {
hsl: hsl,
hex: color.toHexString().toUpperCase(),
rgba: color.toRgb(),
hsv: hsv,
oldHue: data.h || oldHue || hsl.h,
source: data.source,
a: data.a
}
this.onChange && this.onChange();
},

@@ -63,2 +57,2 @@ isValidHex (hex) {

}
}
}
var vue = require('vue-loader')
var path = require('path')
var webpack = require("webpack")
var ExtractTextPlugin = require("extract-text-webpack-plugin")
var projectRoot = path.resolve(__dirname, '../')
var cssLoader = ExtractTextPlugin.extract('style-loader', 'css-loader')
var cssLoader = ExtractTextPlugin.extract("style-loader", "css-loader")
module.exports = {

@@ -17,2 +18,16 @@ entry: {

module: {
preLoaders: [
{
test: /\.vue$/,
loader: 'eslint',
include: projectRoot,
exclude: /node_modules/
},
{
test: /\.js$/,
loader: 'eslint',
include: projectRoot,
exclude: /node_modules/
}
],
loaders: [

@@ -36,13 +51,10 @@ {

test: /\.styl$/,
loader: ExtractTextPlugin.extract("style-loader","css-loader!stylus-loader")
loader: ExtractTextPlugin.extract('style-loader','css-loader!stylus-loader')
}
]
},
// vue: {
// loaders: {
// css: ExtractTextPlugin.extract("css"),
// stylus: ExtractTextPlugin.extract("css!stylus")
// }
// },
devtool: "#source-map",
eslint: {
formatter: require('eslint-friendly-formatter')
},
devtool: '#source-map',
babel: {

@@ -69,9 +81,9 @@ presets: ['es2015'],

new webpack.optimize.OccurenceOrderPlugin()
// new ExtractTextPlugin("build.css")
// new ExtractTextPlugin('build.css')
]
} else {
// module.exports.plugins = [
// new ExtractTextPlugin("build.css")
// new ExtractTextPlugin('build.css')
// ]
// module.exports.devtool = '#source-map'
}

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

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