Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add typings #3

Open
willium opened this issue Dec 19, 2020 · 0 comments
Open

Add typings #3

willium opened this issue Dec 19, 2020 · 0 comments

Comments

@willium
Copy link

willium commented Dec 19, 2020

I started off some typings, would love to see this updated and typed :)

declare module "d3-hsluv" {
	import type { ColorSpaceObject, ColorCommonInstance } from "@d3-color"

	/**
	 * Parses the specified CSS Color Module Level 3 specifier string, returning an RGB color.
	 * If the specifier was not valid, null is returned.
	 * See: http://www.w3.org/TR/css3-color/#colorunits
	 *
	 * @param cssColorSpecifier A CSS Color Module Level 3 specifier string.
	 */
	export function hsluv(cssColorSpecifier: string): RGBColor

	/**
	 * Converts the provided color instance and returns an RGB color. The color instance is converted to the RGB color space using color.rgb.
	 * Note that unlike color.rgb this method always returns a new instance, even if color is already an RGB color.
	 *
	 * @param color A permissible color space instance.
	 */
	export function hsluv(color: ColorSpaceObject | ColorCommonInstance): RGBColor

	/** l, u, v, and optional opacity channels */
	export function hsluv(l: number, u: number, v: number, opacity?: number): void

	/** returns an HSLuv color space interpolator between the two colors a and b */
	export function interpolateHsluv(color1: string, color2: string): void

	/**
	 * Returns an HSLuv color space interpolator between the two colors a and b,
	 * but does not use the shortest path between hues.
	 */
	export function interpolateHsluvLong(color1: string, color2: string): void
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant