Skip to content

Commit 4c22770

Browse files
committed
fixes spelling
1 parent bd6f44a commit 4c22770

3 files changed

Lines changed: 14 additions & 14 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@node-projects/svghmi.webcomponent",
3-
"version": "1.3.0",
3+
"version": "1.4.0",
44
"description": "a svghmi webcomponent.",
55
"type": "module",
66
"main": "./dist/index.js",

src/Converter.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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

4848
function 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

Comments
 (0)