File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -330,27 +330,25 @@ class Color {
330330 if ( ! colorString ) {
331331 colorString = serialize ( this . _color , {
332332 format : outputFormat
333- } ) ;
333+ } ) ;
334334
335- if ( format === '#rrggbb' ) {
336- colorString = String ( colorString ) ;
335+ colorString = String ( colorString ) ;
337336
338- if ( colorString . length <= 5 ) {
339- const match = colorString . match ( / ^ # ? ( [ 0 - 9 a - f A - F ] ) ( [ 0 - 9 a - f A - F ] ) ( [ 0 - 9 a - f A - F ] ) / ) ;
340- if ( match ) {
341- colorString = `#${ match [ 1 ] } ${ match [ 1 ] } ${ match [ 2 ] } ${ match [ 2 ] } ${ match [ 3 ] } ${ match [ 3 ] } ` ;
342- }
343- }
344- if ( colorString . length > 7 ) {
345- colorString = colorString . substring ( 0 , 7 ) ;
346- }
347- colorString = colorString . toLowerCase ( ) ;
337+ if ( colorString . length <= 5 ) {
338+ const match = colorString . match ( / ^ # ? ( [ 0 - 9 a - f A - F ] ) ( [ 0 - 9 a - f A - F ] ) ( [ 0 - 9 a - f A - F ] ) / ) ;
339+ if ( match ) {
340+ colorString = `#${ match [ 1 ] } ${ match [ 1 ] } ${ match [ 2 ] } ${ match [ 2 ] } ${ match [ 3 ] } ${ match [ 3 ] } ` ;
348341 }
349-
350- serializationMap [ key ] = colorString ;
351342 }
343+ if ( colorString . length > 7 ) {
344+ colorString = colorString . substring ( 0 , 7 ) ;
345+ }
346+ colorString = colorString . toLowerCase ( ) ;
347+ serializationMap [ key ] = colorString ;
348+
352349 return colorString ;
353350 }
351+ }
354352
355353 /**
356354 * Checks the contrast between two colors. This method returns a boolean
You can’t perform that action at this time.
0 commit comments