canvas-color-disc
Advanced tools
Comparing version 1.1.1 to 1.1.2
{ | ||
"name": "canvas-color-disc", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Color disc realized by canvas", | ||
@@ -5,0 +5,0 @@ "private": false, |
@@ -41,4 +41,2 @@ <!-- | ||
<p>Hex: {{Hex}}</p> | ||
<p>changing RGB: {{changingRGB}}</p> | ||
<p>changing Hex: {{changingHex}}</p> | ||
<CanvasColorDisc | ||
@@ -49,3 +47,2 @@ id="0" | ||
:height="240" | ||
@changing="changing" | ||
@change="changeColor"></CanvasColorDisc> | ||
@@ -60,5 +57,4 @@ </div> | ||
return { | ||
RGB: { r: 255, g:255, b:255 }, | ||
changingRGB: '', | ||
changingHex: '', | ||
// RGB: { r: 255, g:255, b:255 }, | ||
RGB: '#ff0000', | ||
Hex: '', | ||
@@ -72,6 +68,2 @@ } | ||
}, | ||
changing(newRgb, utils) { | ||
this.changingRGB = JSON.stringify(newRgb) | ||
this.changingHex = `#${utils.RGBToHex(`(${newRgb.r}, ${newRgb.g}, ${newRgb.b})`)}`.toUpperCase() | ||
}, | ||
}, | ||
@@ -91,3 +83,3 @@ } | ||
| id | canvas id拼接 | String | "0" | | ||
| color | 默认颜色 | Object | {"r": 255, "g": 255, "b": 255} | | ||
| color | 默认颜色 | Object | String(如:"#FF0000") | {"r": 255, "g": 255, "b": 255} | | ||
| width | canvas画板宽度 | Number | window.innerWidth * 0.7 | | ||
@@ -100,3 +92,2 @@ | height | canvas画板高度 | Number | window.innerWidth * 0.78 | | ||
| ------------- | ----------- | ----------------------------------------------- | | ||
| changing | 滑动选择回调 | rgb: 颜色, Util: 内置util,可以转换颜色(Util.hvsToRGB、Util.RGBToHvs、Util.RGBToHex、Util.hexToRGB、Util.RGBToHsv、Util.hsvToRgb) | | ||
| change | 选择结束回调 | rgb: 颜色, Util: 内置util,可以转换颜色(Util.hvsToRGB、Util.RGBToHvs、Util.RGBToHex、Util.hexToRGB、Util.RGBToHsv、Util.hsvToRgb) | |
@@ -170,2 +170,5 @@ /* eslint-disable */ | ||
static hexToRGB (hex){ | ||
if(hex.indexOf("#") != -1) { | ||
hex = hex.slice(1); | ||
} | ||
var hexNum = hex; | ||
@@ -172,0 +175,0 @@ var rgb = {}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1016
55880
88