@@ -38,12 +38,12 @@ function parseHmiColor(col: HmiColorInput): ParsedHmiColor | undefined {
3838 return undefined ;
3939}
4040
41- function hmiColorToCssColor ( col : HmiColorInput ) {
42- const parsedColor = parseHmiColor ( col ) ;
43- if ( parsedColor == null )
44- return col ;
45- return `rgba(${ parseInt ( parsedColor . red , 16 ) } , ${ parseInt ( parsedColor . green , 16 ) } , ${ parseInt ( parsedColor . blue , 16 ) } , ${ parseInt ( parsedColor . alpha , 16 ) / 255 } )` ;
46- }
41+ function hmiColorToCssColor ( col : HmiColorInput ) {
42+ const parsedColor = parseHmiColor ( col ) ;
43+ if ( parsedColor == null )
44+ return col ;
45+ return `rgba(${ parseInt ( parsedColor . red , 16 ) } , ${ parseInt ( parsedColor . green , 16 ) } , ${ parseInt ( parsedColor . blue , 16 ) } , ${ parseInt ( parsedColor . alpha , 16 ) / 255 } )` ;
46+ }
4747
4848function hmiColorToRgbColor ( col : HmiColorInput ) {
4949 const parsedColor = parseHmiColor ( col ) ;
@@ -146,7 +146,7 @@ export class Converter {
146146 return hmiColorToAlpha ( col ) ;
147147 }
148148
149- static Iluminate ( input : HmiColorInput , deviation : number , low : HmiColorInput = '#FFFFFF' , high : HmiColorInput = '#000000' ) {
149+ static Illuminate ( input : HmiColorInput , deviation : number , low : HmiColorInput = '#FFFFFF' , high : HmiColorInput = '#000000' ) {
150150 deviation = Math . max ( - 1 , Math . min ( 1 , deviation ) ) ; // Clamp deviation to [-1, 1]
151151
152152 let inputHSL = colorToHSL ( input ) ;
@@ -169,11 +169,11 @@ export class Converter {
169169 }
170170
171171 static Darker ( input : HmiColorInput , deviation : number ) {
172- return this . Iluminate ( input , deviation ) ;
172+ return this . Illuminate ( input , deviation ) ;
173173 }
174174
175175 static Lighter ( input : HmiColorInput , deviation : number ) {
176- return this . Iluminate ( input , - 1 * deviation ) ;
176+ return this . Illuminate ( input , - 1 * deviation ) ;
177177 }
178178
179179 static Bounds ( input : number , min : number , max : number ) {
@@ -185,10 +185,10 @@ export class Converter {
185185 }
186186
187187 static Max ( input : number , max : number ) {
188- return Math . min ( input , max ) ;
188+ return Math . max ( input , max ) ;
189189 }
190190
191- static FormatPattern ( value : string , patter : string ) {
191+ static FormatPattern ( value : string , pattern : string ) {
192192 //TODO...
193193 return value ;
194194 }
0 commit comments