How to use the culori.hsv function in culori

To help you get started, we’ve selected a few culori examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Evercoder / uiuiui / src / ColorPicker / ColorPicker.js View on Github external
const extract_hsba = color => {
	let hsba = culoriHsv(color);
	let ret = {};
	if (!hsba) return ret;
	if (hsba.h !== undefined) ret['hue'] = hsba.h;
	if (hsba.s !== undefined) ret['saturation'] = hsba.s * 100;
	if (hsba.v !== undefined) ret['brightness'] = hsba.v * 100;
	if (hsba.alpha !== undefined) {
		ret['opacity'] = roundi(hsba.alpha * 100);
	} else {
		ret['opacity'] = 100;
	}
	return ret;
};

culori

A general-purpose color library for JavaScript

MIT
Latest version published 1 year ago

Package Health Score

60 / 100
Full package analysis