Home

Awesome

Build Status Package Version Javadocs

About: http://www.hsluv.org

Installation

If you are using Maven, add the following to your pom.xml file:

<dependency>
    <groupId>org.hsluv</groupId>
    <artifactId>hsluv</artifactId>
    <version>1.0</version>
</dependency>

Usage

The API is designed to avoid heap allocation. The HSLuv class defines the following public fields:

To convert between color spaces, simply set the properties of the source color space, run the conversion methods, then read the properties of the target color space.

Use the following methods to convert to and from RGB:

Use the following methods to do step-by-step conversion:

For advanced usage, we also export the bounding lines in slope-intercept format, two for each RGB channel representing the limit of the gamut.

Example:

HsluvColorConverter conv = new HsluvColorConverter();
conv.hsluv_h = 10;
conv.hsluv_s = 75;
conv.hsluv_l = 65;
conv.hsluvToHex();
System.out.println(conv.hex); // Will print "#ec7d82"

Testing

mvn test

Deployment

Docs:

Set ~/m2/settings.xml:

<settings>
    <servers>
        <server>
            <id>ossrh</id>
            <username>hsluv</username>
            <password>REDACTEDREDACTEDREDACTED</password>
        </server>
    </servers>
    <profiles>
        <profile>
            <id>ossrh</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <gpg.passphrase>REDACTEDREDACTEDREDACTED</gpg.passphrase>
            </properties>
        </profile>
    </profiles>
</settings>

Then run:

mvn versions:set -DnewVersion=0.3 # bump version
mvn clean deploy -P release