@@ -65,7 +65,7 @@ function normalizeHue(hue: number): number {
6565// and returns the canonicalized `degree`.
6666function parseAngle ( angleText : string ) : number | null {
6767 const angle = angleText . replace ( / ( d e g | g ? r a d | t u r n ) $ / , '' ) ;
68- // @ts -ignore : isNaN can accept strings
68+ // @ts -expect-error : isNaN can accept strings
6969 if ( isNaN ( angle ) || angleText . match ( / \s + ( d e g | g ? r a d | t u r n ) / ) ) {
7070 return null ;
7171 }
@@ -337,7 +337,7 @@ function parseAlpha(value: string|undefined): number|null {
337337 * - 20% in range [0, 1] is 0.5
338338 */
339339function parsePercentOrNumber ( value : string , range : [ number , number ] = [ 0 , 1 ] ) : number | null {
340- // @ts -ignore : isNaN can accept strings
340+ // @ts -expect-error : isNaN can accept strings
341341 if ( isNaN ( value . replace ( '%' , '' ) ) ) {
342342 return null ;
343343 }
@@ -366,7 +366,7 @@ function parseRgbNumeric(value: string): number|null {
366366
367367export function parseHueNumeric ( value : string ) : number | null {
368368 const angle = value . replace ( / ( d e g | g ? r a d | t u r n ) $ / , '' ) ;
369- // @ts -ignore : isNaN can accept strings
369+ // @ts -expect-error : isNaN can accept strings
370370 if ( isNaN ( angle ) || value . match ( / \s + ( d e g | g ? r a d | t u r n ) / ) ) {
371371 return null ;
372372 }
@@ -385,7 +385,7 @@ export function parseHueNumeric(value: string): number|null {
385385}
386386
387387function parseSatLightNumeric ( value : string ) : number | null {
388- // @ts -ignore : isNaN can accept strings
388+ // @ts -expect-error : isNaN can accept strings
389389 if ( value . indexOf ( '%' ) !== value . length - 1 || isNaN ( value . replace ( '%' , '' ) ) ) {
390390 return null ;
391391 }
@@ -762,7 +762,7 @@ export class Lab implements Color {
762762
763763 #getRGBArray( withAlpha : true ) : Color4DOr3D ;
764764 #getRGBArray( withAlpha : false ) : Color3D ;
765- #getRGBArray( withAlpha : boolean = true ) : Color3D | Color4DOr3D {
765+ #getRGBArray( withAlpha = true ) : Color3D | Color4DOr3D {
766766 const params = ColorConverter . xyzd50ToSrgb ( ...this . #toXyzd50( ) ) ;
767767 if ( withAlpha ) {
768768 return [ ...params , this . alpha ?? undefined ] ;
@@ -899,7 +899,7 @@ export class LCH implements Color {
899899
900900 #getRGBArray( withAlpha : true ) : Color4DOr3D ;
901901 #getRGBArray( withAlpha : false ) : Color3D ;
902- #getRGBArray( withAlpha : boolean = true ) : Color4DOr3D | Color3D {
902+ #getRGBArray( withAlpha = true ) : Color4DOr3D | Color3D {
903903 const params = ColorConverter . xyzd50ToSrgb ( ...this . #toXyzd50( ) ) ;
904904 if ( withAlpha ) {
905905 return [ ...params , this . alpha ?? undefined ] ;
@@ -1039,7 +1039,7 @@ export class Oklab implements Color {
10391039
10401040 #getRGBArray( withAlpha : true ) : Color4DOr3D ;
10411041 #getRGBArray( withAlpha : false ) : Color3D ;
1042- #getRGBArray( withAlpha : boolean = true ) : Color4DOr3D | Color3D {
1042+ #getRGBArray( withAlpha = true ) : Color4DOr3D | Color3D {
10431043 const params = ColorConverter . xyzd50ToSrgb ( ...this . #toXyzd50( ) ) ;
10441044 if ( withAlpha ) {
10451045 return [ ...params , this . alpha ?? undefined ] ;
@@ -1176,7 +1176,7 @@ export class Oklch implements Color {
11761176
11771177 #getRGBArray( withAlpha : true ) : Color4DOr3D ;
11781178 #getRGBArray( withAlpha : false ) : Color3D ;
1179- #getRGBArray( withAlpha : boolean = true ) : Color4DOr3D | Color3D {
1179+ #getRGBArray( withAlpha = true ) : Color4DOr3D | Color3D {
11801180 const params = ColorConverter . xyzd50ToSrgb ( ...this . #toXyzd50( ) ) ;
11811181 if ( withAlpha ) {
11821182 return [ ...params , this . alpha ?? undefined ] ;
@@ -1336,7 +1336,7 @@ export class ColorFunction implements Color {
13361336
13371337 #getRGBArray( withAlpha : true ) : Color4DOr3D ;
13381338 #getRGBArray( withAlpha : false ) : Color3D ;
1339- #getRGBArray( withAlpha : boolean = true ) : Color4DOr3D | Color3D {
1339+ #getRGBArray( withAlpha = true ) : Color4DOr3D | Color3D {
13401340 // With color(), out-of-gamut inputs are to be used for intermediate computations
13411341 const [ p0 , p1 , p2 ] = this . #rawParams;
13421342 const params : Color3D =
@@ -1531,7 +1531,7 @@ export class HSL implements Color {
15311531
15321532 #getRGBArray( withAlpha : true ) : Color4DOr3D ;
15331533 #getRGBArray( withAlpha : false ) : Color3D ;
1534- #getRGBArray( withAlpha : boolean = true ) : Color4DOr3D | Color3D {
1534+ #getRGBArray( withAlpha = true ) : Color4DOr3D | Color3D {
15351535 const rgb = hsl2rgb ( [ this . h , this . s , this . l , 0 ] ) ;
15361536 if ( withAlpha ) {
15371537 return [ rgb [ 0 ] , rgb [ 1 ] , rgb [ 2 ] , this . alpha ?? undefined ] ;
@@ -1682,7 +1682,7 @@ export class HWB implements Color {
16821682
16831683 #getRGBArray( withAlpha : true ) : Color4DOr3D ;
16841684 #getRGBArray( withAlpha : false ) : Color3D ;
1685- #getRGBArray( withAlpha : boolean = true ) : Color4DOr3D | Color3D {
1685+ #getRGBArray( withAlpha = true ) : Color4DOr3D | Color3D {
16861686 const rgb = hwb2rgb ( [ this . h , this . w , this . b , 0 ] ) ;
16871687 if ( withAlpha ) {
16881688 return [ rgb [ 0 ] , rgb [ 1 ] , rgb [ 2 ] , this . alpha ?? undefined ] ;
@@ -2200,9 +2200,9 @@ export class Legacy implements Color {
22002200 }
22012201}
22022202
2203- export const Regex : RegExp =
2203+ export const Regex =
22042204 / ( (?: r g b a ? | h s l a ? | h w b a ? | l a b | l c h | o k l a b | o k l c h | c o l o r ) \( [ ^ ) ] + \) | # [ 0 - 9 a - f A - F ] { 8 } | # [ 0 - 9 a - f A - F ] { 6 } | # [ 0 - 9 a - f A - F ] { 3 , 4 } | \b [ a - z A - Z ] + \b (? ! - ) ) / g;
2205- export const ColorMixRegex : RegExp = / c o l o r - m i x \( .* , \s * (?< firstColor > .+ ) \s * , \s * (?< secondColor > .+ ) \s * \) / g;
2205+ export const ColorMixRegex = / c o l o r - m i x \( .* , \s * (?< firstColor > .+ ) \s * , \s * (?< secondColor > .+ ) \s * \) / g;
22062206
22072207const COLOR_TO_RGBA_ENTRIES : Array < readonly [ string , number [ ] ] > = [
22082208 [ 'aliceblue' , [ 240 , 248 , 255 ] ] ,
0 commit comments