GithubHelp home page GithubHelp logo

petulla / d3-hsluv Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 4.0 52 KB

D3 implementation of human-friendly HSL

License: BSD 3-Clause "New" or "Revised" License

JavaScript 100.00%
color color-palette d3 hsluv rgb

d3-hsluv's People

Contributors

petulla avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

d3-hsluv's Issues

Add typings

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
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.