{"id":18705206,"url":"https://github.com/hsluv/hsluv-java","last_synced_at":"2025-09-03T21:31:00.665Z","repository":{"id":57742070,"uuid":"56616707","full_name":"hsluv/hsluv-java","owner":"hsluv","description":"Java implementation of HSLuv (revision 4)","archived":false,"fork":false,"pushed_at":"2024-06-28T08:21:02.000Z","size":1585,"stargazers_count":24,"open_issues_count":0,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-12-23T21:11:42.983Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hsluv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-19T17:16:52.000Z","updated_at":"2024-09-19T20:31:27.000Z","dependencies_parsed_at":"2024-06-28T09:41:09.354Z","dependency_job_id":"7380271c-b29c-429e-8997-c2a022d14ae5","html_url":"https://github.com/hsluv/hsluv-java","commit_stats":null,"previous_names":["husl-colors/husl-java"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsluv%2Fhsluv-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsluv%2Fhsluv-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsluv%2Fhsluv-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsluv%2Fhsluv-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hsluv","download_url":"https://codeload.github.com/hsluv/hsluv-java/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231918539,"owners_count":18445747,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T12:10:02.007Z","updated_at":"2024-12-30T22:08:38.836Z","avatar_url":"https://github.com/hsluv.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://github.com/hsluv/hsluv-java/actions/workflows/test.yml/badge.svg)](https://github.com/hsluv/hsluv-java/actions/workflows/test.yml)\n[![Package Version](https://img.shields.io/maven-central/v/org.hsluv/hsluv.svg)](http://repo1.maven.org/maven2/org/hsluv/hsluv/)\n[![Javadocs](http://www.javadoc.io/badge/org.hsluv/hsluv.svg)](http://www.javadoc.io/doc/org.hsluv/hsluv)\n\nAbout: http://www.hsluv.org\n\n# Installation\n\nIf you are using Maven, add the following to your `pom.xml` file:\n\n    \u003cdependency\u003e\n        \u003cgroupId\u003eorg.hsluv\u003c/groupId\u003e\n        \u003cartifactId\u003ehsluv\u003c/artifactId\u003e\n        \u003cversion\u003e1.0\u003c/version\u003e\n    \u003c/dependency\u003e\n\n# Usage\n\nThe API is designed to avoid heap allocation. The `HSLuv` class defines the following public fields:\n\n- RGB: `hex:String`, `rgb_r` [0;1], `rgb_g` [0;1], `rgb_r` [0;1]\n- CIE XYZ: `xyz_x`, `xyz_y`, `xyz_z`\n- CIE LUV: `luv_l`, `luv_u`, `luv_v`\n- CIE LUV LCh: `lch_l`, `lch_c`, `lch_h`\n- HSLuv: `hsluv_h` [0;360], `hsluv_s` [0;100], `hsluv_l` [0;100]\n- HPLuv: `hpluv_h` [0;360], `hpluv_p` [0;100], `hpluv_l` [0;100]\n\nTo convert between color spaces, simply set the properties of the source color space, run the\nconversion methods, then read the properties of the target color space.\n\nUse the following methods to convert to and from RGB:\n\n- HSLuv: `hsluvToRgb()`, `hsluvToHex()`, `rgbToHsluv()`, `hexToHsluv()`\n- HPLuv: `hpluvToRgb()`, `hpluvToHex()`, `rgbToHpluv()`, `hexToHpluv()`\n\nUse the following methods to do step-by-step conversion:\n\n- Forward: `hsluvToLch()` (or `hpluvToLch()`), `lchToLuv()`, `luvToXyz()`, `xyzToRgb()`, `rgbToHex()`\n- Backward: `hexToRgb()`, `rgbToXyz()`, `xyzToLuv()`, `luvToLch()`, `lchToHsluv()` (or `lchToHpluv()`)\n\nFor advanced usage, we also export the [bounding lines](https://www.hsluv.org/math/) in slope-intercept\nformat, two for each RGB channel representing the limit of the gamut.\n\n- R \u003c 0: `r0s`, `r0i`\n- R \u003e 1: `r1s`, `r1i`\n- G \u003c 0: `g0s`, `g0i`\n- G \u003e 1: `g1s`, `g1i`\n- B \u003c 0: `b0s`, `b0i`\n- B \u003e 1: `b1s`, `b1i`\n\nExample:\n\n```java\nHsluvColorConverter conv = new HsluvColorConverter();\nconv.hsluv_h = 10;\nconv.hsluv_s = 75;\nconv.hsluv_l = 65;\nconv.hsluvToHex();\nSystem.out.println(conv.hex); // Will print \"#ec7d82\"\n```\n\n# Testing\n\n    mvn test\n\n# Deployment\n\nDocs:\n\n- https://central.sonatype.org/publish/publish-maven/\n- https://central.sonatype.org/publish/requirements/gpg/\n\nSet `~/m2/settings.xml`:\n\n```xml\n\u003csettings\u003e\n    \u003cservers\u003e\n        \u003cserver\u003e\n            \u003cid\u003eossrh\u003c/id\u003e\n            \u003cusername\u003ehsluv\u003c/username\u003e\n            \u003cpassword\u003eREDACTEDREDACTEDREDACTED\u003c/password\u003e\n        \u003c/server\u003e\n    \u003c/servers\u003e\n    \u003cprofiles\u003e\n        \u003cprofile\u003e\n            \u003cid\u003eossrh\u003c/id\u003e\n            \u003cactivation\u003e\n                \u003cactiveByDefault\u003etrue\u003c/activeByDefault\u003e\n            \u003c/activation\u003e\n            \u003cproperties\u003e\n                \u003cgpg.passphrase\u003eREDACTEDREDACTEDREDACTED\u003c/gpg.passphrase\u003e\n            \u003c/properties\u003e\n        \u003c/profile\u003e\n    \u003c/profiles\u003e\n\u003c/settings\u003e\n```\n\nThen run:\n\n```bash\nmvn versions:set -DnewVersion=0.3 # bump version\nmvn clean deploy -P release\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhsluv%2Fhsluv-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhsluv%2Fhsluv-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhsluv%2Fhsluv-java/lists"}