mirror of
https://github.com/konvajs/konva.git
synced 2025-07-15 10:12:44 +08:00
fixes #391
This commit is contained in:
parent
9160b694ae
commit
8657c57436
@ -283,6 +283,14 @@
|
|||||||
_rgbToHex: function(r, g, b) {
|
_rgbToHex: function(r, g, b) {
|
||||||
return ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
|
return ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
|
||||||
},
|
},
|
||||||
|
_hexToRgb: function(hex) {
|
||||||
|
var bigint = parseInt(hex, 16);
|
||||||
|
return {
|
||||||
|
r: (bigint >> 16) & 255,
|
||||||
|
g: (bigint >> 8) & 255,
|
||||||
|
b: bigint & 255
|
||||||
|
};
|
||||||
|
},
|
||||||
_getRandomColorKey: function() {
|
_getRandomColorKey: function() {
|
||||||
var randColor = (Math.random() * 0xFFFFFF << 0).toString(16);
|
var randColor = (Math.random() * 0xFFFFFF << 0).toString(16);
|
||||||
while (randColor.length < 6) {
|
while (randColor.length < 6) {
|
||||||
|
Loading…
Reference in New Issue
Block a user