Created
January 21, 2021 09:22
-
-
Save Fohlen/dcf33a6d0abfe7d2b6ff620dd5aa52dd to your computer and use it in GitHub Desktop.
(Incomplete) TypeScript typings for color-scheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare module 'color-scheme' { | |
export interface ColorScheme { | |
/** | |
* Set the scheme to [scheme_name]. The possible values are 'mono', 'contrast', 'triade', 'tetrade', and 'analogic'. | |
*/ | |
scheme(scheme_name: string): ColorScheme; | |
/** | |
* Note: Only works with the schemes 'triade', 'tetrade', and 'analogic'. (Because 'mono' only has one source color, and with 'contrast' the two source colors are always 180 degrees away from each other.) | |
* This method sets the distance of the additional source colors from the initial hue. The value must be a float from 0 to 1. | |
*/ | |
distance(degree: number): ColorScheme; | |
/** | |
* Use the specific color variation | |
*/ | |
variation(variation: string): ColorScheme; | |
/** | |
* Returns the array of generated colors as hex values. | |
*/ | |
colors(): string[] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment