Skip to content

Commit

Permalink
feat: isRgb and isRgba functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mineejo committed Nov 21, 2023
1 parent 6f3a8f5 commit f169b89
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions color/is/isRgb.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright 2023 mineejo. All rights reserved. MIT license.

import { Rgb } from "../rgb.ts";
import { Rgba } from "../rgba.ts";

export function isRgb(components: Rgba | Rgb): boolean {
return components.length === 3;
}
8 changes: 8 additions & 0 deletions color/is/isRgba.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright 2023 mineejo. All rights reserved. MIT license.

import { Rgb } from "../rgb.ts";
import { Rgba } from "../rgba.ts";

export function isRgba(components: Rgba | Rgb): boolean {
return components.length === 4;
}

0 comments on commit f169b89

Please sign in to comment.