{"id":18705193,"url":"https://github.com/hsluv/hsluv-php","last_synced_at":"2025-04-12T10:07:05.598Z","repository":{"id":56986404,"uuid":"70176750","full_name":"hsluv/hsluv-php","owner":"hsluv","description":"PHP implementation of HSLuv (revision 4)","archived":false,"fork":false,"pushed_at":"2024-12-01T14:20:59.000Z","size":1555,"stargazers_count":15,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T04:51:11.624Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","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}},"created_at":"2016-10-06T17:29:00.000Z","updated_at":"2024-12-02T07:47:31.000Z","dependencies_parsed_at":"2022-08-21T13:20:19.050Z","dependency_job_id":null,"html_url":"https://github.com/hsluv/hsluv-php","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsluv%2Fhsluv-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsluv%2Fhsluv-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsluv%2Fhsluv-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsluv%2Fhsluv-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hsluv","download_url":"https://codeload.github.com/hsluv/hsluv-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248546094,"owners_count":21122253,"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:00.972Z","updated_at":"2025-04-12T10:07:05.571Z","avatar_url":"https://github.com/hsluv.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HSLuv-php\n\n[![Build Status](https://github.com/hsluv/hsluv-php/actions/workflows/test.yml/badge.svg)](https://github.com/hsluv/hsluv-php/actions/workflows/test.yml)\n\nPort to PHP (5.6+) from Python / JS of [HSLuv](http://www.hsluv.org/) (revision 4).\n\nTo run the tests:\n```\ncomposer install\n./vendor/bin/phpunit\n```\n\n# Usage\n\n```\ncomposer require \"hsluv/hsluv\"\n```\n\n# From RGB / hex to HSLuv\n\n````php\n// From hex upper / lowercase\n$out = HSLuv::fromHex( '#fabada' );\n$out = HSLuv::fromHex( '#FABADA' );\n\n// From RGB (float) in 0.0 - 1.0 range\n$out = HSLuv::fromRgb( 0.9803921568627451, 0.7294117647058823, 0.8549019607843137 );\n$out = HSLuv::fromRgb( array( 0.9803921568627451, 0.7294117647058823, 0.8549019607843137 ) );\n\n// From RGB (int) in 0 - 255 range\n$out = HSLuv::fromRgbInt( 250, 186, 218 );\n$out = HSLuv::fromRgbInt( 250.0, 186.0, 218.0 );\n$out = HSLuv::fromRgbInt( array( 250, 186, 218 ) );\n$out = HSLuv::fromRgbInt( array( 250.0, 186.0, 218.0 ) );\n````\n\nReturns HSLuv an array of **float** values ( H, S, L ).\n\n# From HSLuv to RGB / hex\n\nParameters are float H, S, L componets or an array.\n\n```php\n// Rgb: returns array of (float) in 0.0 - 1.0 range\n$out = HSLuv::toRgb( $h, $s, $l )\n$out = HSLuv::toRgb( array( $h, $s, $l ) )\n\n// Rgb: returns array if (int) in 0 - 255 range\n$out = HSLuv::toRgbInt( $h, $s, $l )\n$out = HSLuv::toRgbInt( array( $h, $s, $l ) )\n\n// Hex: returns lowercase string including \"#\"\n$out = HSLuv::toHex( $h, $s, $l )\n$out = HSLuv::toRgb( array( $h, $s, $l ) )\n```\n\n# Authors\n\n- Port by Carlos Cabo ([carloscabo](https://github.com/carloscabo))\n- Support with tests and packaging ([tasugo](https://github.com/tasugo))\n- Original HSLuv author: Alexei Boronine ([boronine](http://github.com/boronine))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhsluv%2Fhsluv-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhsluv%2Fhsluv-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhsluv%2Fhsluv-php/lists"}