Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

husl

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

husl - npm Package Compare versions

Comparing version 6.0.2-alpha.1 to 6.0.2-alpha.2

dist/husl.min.js

6

package.json

@@ -5,7 +5,7 @@ {

"keywords": ["color", "color space", "CIE", "RGB", "HUSL", "HSL"],
"version": "6.0.2-alpha.1",
"version": "6.0.2-alpha.2",
"author": "Alexei Boronine <alexei@boronine.com>",
"license": "MIT",
"main": "../dist/husl.min.js",
"files": ["../dist/husl.min.js"],
"main": "dist/husl.min.js",
"files": ["dist/husl.min.js"],
"repository": {

@@ -12,0 +12,0 @@ "type" : "git",

@@ -1,50 +0,29 @@

# HUSL - JavaScript implementation
[![Build Status](https://travis-ci.org/husl-colors/husl.svg?branch=master)](https://travis-ci.org/husl-colors/husl)
[![NPM package](https://img.shields.io/npm/v/husl.svg)](https://www.npmjs.com/package/husl)
## Installation
# HUSL - Human-friendly HSL
Client-side: download the latest husl.min.js from the
[releases page](https://github.com/husl-colors/husl/releases).
Once this module is loaded in the browser, you can access it via the
global ``window.HUSL``.
[Explanation, demo, ports etc.](http://www.husl-colors.org)
Server-side: ``npm install husl``.
The reference implementation is [written in Haxe](https://github.com/husl-colors/husl/tree/master/haxe).
## Usage
## Building
**husl.toHex(hue, saturation, lightness)**
Requirements: GNU Make, Haxe 3, JDK 7+.
*hue* is a number between 0 and 360, *saturation* and *lightness* are
numbers between 0 and 100. This function returns the resulting color as
a hex string.
To build the JavaScript version:
**husl.toRGB(hue, saturation, lightness)**
```sh
make bin/husl.min.js
```
Like above, but returns an array of 3 numbers between 0 and 1, for the
r, g, and b channel.
To build Haxe documentation:
**husl.fromHex(hex)**
```sh
make dist/doc
```
Takes a hex string and returns the HUSL color as array that contains
the hue (0-360), saturation(0-100) and lightness(0-100) channel.
_Note_: The result can have rounding errors. For example saturation can
be 100.00000000000007
## Versioning
**husl.fromRGB(red, green, blue)**
Like above, but *red*, *green* and *blue* are passed as numbers between
0 and 1.
Use **husl.p.toHex**, **husl.p.toRGB**, **husl.p.fromHex** and
**husl.p.fromRGB** for the pastel variant (HUSLp). Note that HUSLp does
not contain all the colors of RGB, so converting arbitrary RGB to it may
generate invalid HUSLp colors.
HUSL can also be used as a [Stylus](http://learnboost.github.com/stylus/)
plugin. See [here](https://github.com/husl-colors/husl-stylus).
## Testing
```sh
node test.js
```
Following [semantic versioning](http://semver.org/), the major version must be incremented
whenever the color math changes. These changes can be tested for with snapshot files.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc