You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

github.com/husl-colors/husl-go

Package Overview
Dependencies
0
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/husl-colors/husl-go


Version published

Readme

Source

Build Status

Go port of HSLuv (revision 4), written by Michael Glanznig

More details about HSLuv at http://www.hsluv.org.

API

hsluv.HsluvToHex(hue, saturation, lightness)

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.

hsluv.HsluvlToRGB(hue, saturation, lightness)

Like above, but returns 3 numbers between 0 and 1, for the r, g, and b channel.

hsluv.HsluvFromHex(hex)

Takes a hex string and returns the HSLuv color as 3 numbers for hue (0-360), saturation (0-100) and lightness (0-100). Note: The result can have rounding errors. For example saturation can be 100.00000000000007

hsluv.HsluvFromRGB(red, green, blue)

Like above, but red, green and blue are passed as numbers between 0 and 1.

Use HpluvToHex, HpluvToRGB, HpluvFromHex and HpluvFromRGB for the pastel variant (HPLuv).

Testing

Run go test.

Thanks

Testing was inspired by omniscale/magnacarto.

FAQs

Package last updated on 17 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc