Skip to content

Commit

Permalink
fix: types ColorRepresentation (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
pschroen authored May 27, 2024
1 parent 81adcd3 commit 1e35a66
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions types/math/Color.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
export type ColorTuple = [r: number, g: number, b: number];

export type ColorRepresentation =
| number
| ColorTuple
| Color
| 'black'
| 'white'
| 'red'
Expand All @@ -12,14 +13,14 @@ export type ColorRepresentation =
| 'yellow'
| 'orange'
| string
| ColorTuple;
| number;

/**
* Represents a color.
* @see {@link https://github.com/oframe/ogl/blob/master/src/math/Color.js | Source}
*/
export class Color extends Array<number> {
constructor(color?: number | Color | ColorRepresentation, g?: number, b?: number);
constructor(color?: ColorRepresentation, g?: number, b?: number);

get r(): number;

Expand All @@ -33,7 +34,7 @@ export class Color extends Array<number> {

set b(v: number);

set(color?: number | Color | ColorRepresentation, g?: number, b?: number): this;
set(color?: ColorRepresentation, g?: number, b?: number): this;

copy(v: Color): this;
}

0 comments on commit 1e35a66

Please sign in to comment.