Comparing version 2.4.3 to 2.4.4
{ | ||
"name": "vue-color", | ||
"version": "2.4.3", | ||
"version": "2.4.4", | ||
"description": "Color of Vue Components", | ||
@@ -31,3 +31,3 @@ "keywords": [ | ||
"babel-plugin-transform-runtime": "^6.22.0", | ||
"babel-preset-es2015": "^6.0.0", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-preset-stage-2": "^6.22.0", | ||
@@ -34,0 +34,0 @@ "chalk": "^2.0.1", |
@@ -59,26 +59,19 @@ # vue-color | ||
## Usage | ||
```js | ||
var defaultProps = { | ||
var colors = { | ||
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 | ||
}, | ||
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 | ||
} | ||
// or | ||
var colors = '#194d33' | ||
// or | ||
var colors = { h: 150, s: 0.66, v: 0.30 } | ||
// or | ||
var colors = { r: 255, g: 0, b: 0 } | ||
// etc... | ||
@@ -96,4 +89,6 @@ new Vue({ | ||
}, | ||
data: { | ||
colors: defaultProps | ||
data () { | ||
return { | ||
colors | ||
} | ||
} | ||
@@ -104,2 +99,4 @@ }) | ||
`colors` accepts either a string of a hex color '#333' or a object of rgb or hsl values `{ r: 51, g: 51, b: 51 }` or `{ h: 0, s: 0, l: .10 }`, whatever [tinycolor2](https://www.npmjs.com/package/tinycolor2) accepts as an input. | ||
```html | ||
@@ -122,10 +119,4 @@ <!-- suppose you have the data 'colors' in your component --> | ||
## TODO | ||
-[] docs | ||
-[] more components | ||
## License | ||
vue-color is licensed under [The MIT License](LICENSE). |
@@ -16,3 +16,3 @@ import Compact from './components/Compact.vue' | ||
const VueColor = { | ||
version: '2.4.3', | ||
version: '2.4.4', | ||
Compact, | ||
@@ -19,0 +19,0 @@ Material, |
@@ -27,14 +27,16 @@ import tinycolor from 'tinycolor2' | ||
/* --- comment this block to fix #109, may cause #25 again --- */ | ||
// when the hsv.v is less than 0.0164 (base on test) | ||
// because of possible loss of precision | ||
// the result of hue and saturation would be miscalculated | ||
if (hsv.v < 0.0164) { | ||
hsv.h = data.h || (data.hsv && data.hsv.h) || 0 | ||
hsv.s = data.s || (data.hsv && data.hsv.s) || 0 | ||
} | ||
// if (hsv.v < 0.0164) { | ||
// hsv.h = data.h || (data.hsv && data.hsv.h) || 0 | ||
// hsv.s = data.s || (data.hsv && data.hsv.s) || 0 | ||
// } | ||
if (hsl.l < 0.01) { | ||
hsl.h = data.h || (data.hsl && data.hsl.h) || 0 | ||
hsl.s = data.s || (data.hsl && data.hsl.s) || 0 | ||
} | ||
// if (hsl.l < 0.01) { | ||
// hsl.h = data.h || (data.hsl && data.hsl.h) || 0 | ||
// hsl.s = data.s || (data.hsl && data.hsl.s) || 0 | ||
// } | ||
/* ------ */ | ||
@@ -41,0 +43,0 @@ return { |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
950302
5959
119