GithubHelp home page GithubHelp logo

hsluv-clj's Introduction

hsluv-clj

A human-friendly alternative to the HSL color space, in pure Clojure.

Parent project: HSLuv (website; GitHub project). This is a port of the Java implementation.

HSLuv-clj requires Clojure 1.10 and works on a JVM only.

Quality status: inadequate

The library is riddled with bugs and is insufficiently tested/documented. Don’t use it.

Soon to come

  • Acceptable quality
  • Testing against the HSLuv exemplars
  • Property-based testing
  • Minimal Clojure dependency
  • Better docstrings
  • Polymorphism
  • ClojureScript compatibility

Usage

Use any function in the hsluv-clj.hsluv namespace to transform colours from one representation to another.

All functions from the reference implementation are available. Function names are in lisp-case, with the word ‘to’ replaced with the string -> (for example: hsluvToRgb is hsluv->rgb). All functions are pure.

Example

Note: this example does not yet work correctly, and I am very sorry. >_>

(require '[hsluv-clj.hsluv :as hsluv])

(def rebeccapurple "#663399")

(hsluv/hex->hsluv rebeccapurple)
;; => [280.8 70.8 32.9]

;; This is identical to Rebecca Purple except ⅓ darker.
(def dark-rebecca [280.8 70.8 21.9])

(hsluv/hsluv->hex dark-rebecca)
;; => "#46216b"

License

Copyright © 2020 Benjamin Francis Goodger.

This library is licensed under the MIT License; see the LICENSE file for details.

hsluv-clj's People

Contributors

goodgerster avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

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.