File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ export default class ModifyColorHelper {
1313 if ( ! color || ! color . type || element ?. getElementsByTagName === undefined )
1414 return ;
1515
16+ ModifyColorHelper . normalizeColorObject ( color ) ;
17+
1618 const solidFills = element . getElementsByTagName ( 'a:solidFill' ) ;
1719
1820 if ( ! solidFills . length ) {
@@ -49,4 +51,15 @@ export default class ModifyColorHelper {
4951 element . removeChild ( hasNoFill ) ;
5052 }
5153 } ;
54+
55+ static normalizeColorObject = ( color : Color ) => {
56+ if ( color . value . indexOf ( '#' ) === 0 ) {
57+ color . value = color . value . replace ( '#' , '' ) ;
58+ }
59+ if ( color . value . toLowerCase ( ) . indexOf ( 'rgb(' ) === 0 ) {
60+ // TODO: convert RGB to HEX
61+ color . value = 'cccccc' ;
62+ }
63+ return color ;
64+ } ;
5265}
You can’t perform that action at this time.
0 commit comments