Skip to content

Commit

Permalink
Fix incorrect type definition for Range
Browse files Browse the repository at this point in the history
The function represented by Range should return a Color, not a
number.

Fixes #298.
  • Loading branch information
nsilvestri authored and LeaVerou committed Apr 10, 2023
1 parent cf124a4 commit e8d75a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion types/src/interpolation.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Color, { ColorTypes } from "./color";
import ColorSpace from "./space";
import { Methods } from "./deltaE/index";

export type Range = ((percentage: number) => number) & {
export type Range = ((percentage: number) => Color) & {

This comment has been minimized.

Copy link
@lloydk

lloydk Apr 11, 2023

Collaborator

I think this should be a ColorObject or if #291 is merged a PlainColorObject.

rangeArgs: { colors: [Color, Color]; options: Record<string, any> };

This comment has been minimized.

Copy link
@lloydk

lloydk Apr 11, 2023

Collaborator

I think the two Color elements of the array should also be changed to ColorObject or PlainColorObject.

};

Expand Down

0 comments on commit e8d75a2

Please sign in to comment.