mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
[groups] Remove padStart because IE11
This commit is contained in:
parent
6ff3286d78
commit
24f7000918
@ -17,7 +17,8 @@ RED.colorPicker = (function() {
|
||||
r = Math.max(0,r-50);
|
||||
g = Math.max(0,g-50);
|
||||
b = Math.max(0,b-50);
|
||||
return '#'+((r<<16) + (g<<8) + b).toString(16).padStart(6,'0')
|
||||
var s = ((r<<16) + (g<<8) + b).toString(16);
|
||||
return '#'+'000000'.slice(0, 6-s.length)+s;
|
||||
}
|
||||
|
||||
function create(options) {
|
||||
|
@ -78,7 +78,8 @@ RED.group = (function() {
|
||||
r = Math.min(255,Math.floor(r+j*dr));
|
||||
g = Math.min(255,Math.floor(g+j*dg));
|
||||
b = Math.min(255,Math.floor(b+j*db));
|
||||
colorPalette.push('#'+((r<<16) + (g<<8) + b).toString(16).padStart(6,'0'));
|
||||
var s = ((r<<16) + (g<<8) + b).toString(16);
|
||||
colorPalette.push('#'+'000000'.slice(0, 6-s.length)+s);
|
||||
}
|
||||
|
||||
var defaultGroupStyle = {};
|
||||
@ -207,7 +208,8 @@ RED.group = (function() {
|
||||
function convertColorToHex(c) {
|
||||
var m = /^rgb\((\d+), (\d+), (\d+)\)$/.exec(c);
|
||||
if (m) {
|
||||
return "#"+(((parseInt(m[1])<<16) + (parseInt(m[2])<<8) + parseInt(m[3])).toString(16).padStart(6,'0'))
|
||||
var s = ((parseInt(m[1])<<16) + (parseInt(m[2])<<8) + parseInt(m[3])).toString(16)
|
||||
return '#'+'000000'.slice(0, 6-s.length)+s;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user