File tree Expand file tree Collapse file tree 3 files changed +6
-7
lines changed
project-editor/features/style Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 77 "node_modules" : true ,
88 "libs" : false ,
99 "build" : false ,
10- "dist" : true ,
11- "resources/eez-framework-amalgamation" : true
10+ "dist" : true
1211 },
1312 "typescript.reportStyleChecksAsWarnings" : false ,
1413 "typescript.suggest.autoImports" : true ,
Original file line number Diff line number Diff line change @@ -292,7 +292,7 @@ export function parseColorString(
292292 color = color . trim ( ) ;
293293
294294 // #RRGGBB or #RGB
295- if ( / ^ # [ 0 - 9 a - f A - F ] { 6 } $ / . test ( color ) ) {
295+ if ( / ^ # ? [ 0 - 9 a - f A - F ] { 6 } $ / . test ( color ) ) {
296296 const v = parseInt ( color . slice ( 1 ) , 16 ) ;
297297 return {
298298 r : ( v >> 16 ) & 0xff ,
@@ -301,7 +301,7 @@ export function parseColorString(
301301 a : 1
302302 } ;
303303 }
304- if ( / ^ # [ 0 - 9 a - f A - F ] { 3 } $ / . test ( color ) ) {
304+ if ( / ^ # ? [ 0 - 9 a - f A - F ] { 3 } $ / . test ( color ) ) {
305305 const hex = color . slice ( 1 ) ;
306306 const expanded =
307307 hex [ 0 ] + hex [ 0 ] + hex [ 1 ] + hex [ 1 ] + hex [ 2 ] + hex [ 2 ] ;
@@ -315,7 +315,7 @@ export function parseColorString(
315315 }
316316
317317 // #RRGGBBAA or #RGBA
318- if ( / ^ # [ 0 - 9 a - f A - F ] { 8 } $ / . test ( color ) ) {
318+ if ( / ^ # ? [ 0 - 9 a - f A - F ] { 8 } $ / . test ( color ) ) {
319319 const v = parseInt ( color . slice ( 1 ) , 16 ) ;
320320 return {
321321 r : ( v >> 24 ) & 0xff ,
@@ -324,7 +324,7 @@ export function parseColorString(
324324 a : ( ( v & 0xff ) / 255 )
325325 } ;
326326 }
327- if ( / ^ # [ 0 - 9 a - f A - F ] { 4 } $ / . test ( color ) ) {
327+ if ( / ^ # ? [ 0 - 9 a - f A - F ] { 4 } $ / . test ( color ) ) {
328328 const hex = color . slice ( 1 ) ;
329329 const expanded =
330330 hex [ 0 ] + hex [ 0 ] + hex [ 1 ] + hex [ 1 ] + hex [ 2 ] + hex [ 2 ] + hex [ 3 ] + hex [ 3 ] ;
Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ export class ColorFormat {
157157 input = input . trim ( ) ;
158158
159159 // 1) #RRGGBB or #RGB
160- if ( / ^ # [ 0 - 9 a - f A - F ] { 3 , 6 } $ / . test ( input ) ) {
160+ if ( / ^ # ? [ 0 - 9 a - f A - F ] { 3 , 6 } $ / . test ( input ) ) {
161161 cf . formatType = ColorFormatType . HEX_HASH ;
162162 const hexPart = input . slice ( 1 ) ;
163163 cf . hexUpperCase = hexPart === hexPart . toUpperCase ( ) ;
You can’t perform that action at this time.
0 commit comments