Skip to content

Commit

Permalink
chore: apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Mar 28, 2024
1 parent 73e983d commit 4020bd0
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import { inputHex } from "./plugin/inputHex";
import { inputNamed } from "./plugin/inputNamed";
import type { Alpha, Format, FormatResult, RGB_B, RGB_G, RGB_R, TColorRGBA } from "./type";
import type {
Alpha,
Format,
FormatResult,
RGB_B,
RGB_G,
RGB_R,
TColorRGBA,
} from "./type";
import U from "./utils";

const IS_MYCOLOR = "$isMyColorObject";
Expand Down Expand Up @@ -99,10 +107,15 @@ class MyColor {
public format<T extends Format = Format>(f: T): FormatResult[T] {
switch (f) {
case "object": {
return { r: this.r, g: this.g, b: this.b, a: this.a } as FormatResult[T];
return {
r: this.r,
g: this.g,
b: this.b,
a: this.a,
} as FormatResult[T];
}
case "array": {
return [this.r, this.g, this.b, this.a] as FormatResult[T];
return [this.r, this.g, this.b, this.a] as FormatResult[T];
}
case "string": {
return `rgba(${this.r},${this.g},${this.b},${this.a})` as FormatResult[T];
Expand Down

0 comments on commit 4020bd0

Please sign in to comment.