mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-04-27 16:54:43 +00:00
Add support for transparent value in fabric.Color
This commit is contained in:
parent
916b35b93d
commit
87b0f2da35
2 changed files with 9 additions and 0 deletions
|
|
@ -43,6 +43,11 @@
|
|||
color = Color.colorNameMap[color];
|
||||
}
|
||||
|
||||
if (color === 'transparent') {
|
||||
this.setSource([255,255,255,0]);
|
||||
return;
|
||||
}
|
||||
|
||||
source = Color.sourceFromHex(color);
|
||||
|
||||
if (!source) {
|
||||
|
|
|
|||
|
|
@ -324,4 +324,8 @@
|
|||
oColor.overlayWith(new fabric.Color('rgb(0,0,0)'));
|
||||
equal(oColor.toRgb(), 'rgb(128,128,128)');
|
||||
});
|
||||
|
||||
test('transparent', function() {
|
||||
deepEqual(new fabric.Color('transparent').getSource(), [255,255,255,0]);
|
||||
});
|
||||
})();
|
||||
|
|
|
|||
Loading…
Reference in a new issue