{"id":16673050,"url":"https://github.com/lasserafn/php-hexer","last_synced_at":"2025-04-09T20:05:53.330Z","repository":{"id":57012646,"uuid":"94527137","full_name":"LasseRafn/php-hexer","owner":"LasseRafn","description":"Modify HEX brightness","archived":false,"fork":false,"pushed_at":"2024-02-15T17:48:37.000Z","size":27,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T20:05:46.359Z","etag":null,"topics":["brightness","color","darken","hex","lighten","php"],"latest_commit_sha":null,"homepage":null,"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/LasseRafn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2017-06-16T09:14:06.000Z","updated_at":"2022-10-15T05:14:44.000Z","dependencies_parsed_at":"2025-02-15T19:31:34.039Z","dependency_job_id":"b083b3d6-6c64-4879-a60c-5cbbfed3ed03","html_url":"https://github.com/LasseRafn/php-hexer","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasseRafn%2Fphp-hexer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasseRafn%2Fphp-hexer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasseRafn%2Fphp-hexer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasseRafn%2Fphp-hexer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LasseRafn","download_url":"https://codeload.github.com/LasseRafn/php-hexer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103872,"owners_count":21048245,"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":["brightness","color","darken","hex","lighten","php"],"created_at":"2024-10-12T12:24:19.707Z","updated_at":"2025-04-09T20:05:53.306Z","avatar_url":"https://github.com/LasseRafn.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HEX color modifier — brightness, conversion and more.\n\nEver wanted to lighten or darken a hex in PHP? This package will allow you to.\nIt's easy to use, fully tested and is very lightweight.\n\n**+ Added the ability to convert to RGB**\n\n\u003cp align=\"center\"\u003e \n\u003ca href=\"https://travis-ci.org/LasseRafn/php-hexer\"\u003e\u003cimg src=\"https://img.shields.io/travis/LasseRafn/php-hexer.svg?style=flat-square\" alt=\"Build Status\"\u003e\u003c/a\u003e\n\u003ca href=\"https://coveralls.io/github/LasseRafn/php-hexer\"\u003e\u003cimg src=\"https://img.shields.io/coveralls/LasseRafn/php-hexer.svg?style=flat-square\" alt=\"Coverage\"\u003e\u003c/a\u003e\n\u003ca href=\"https://styleci.io/repos/94527137\"\u003e\u003cimg src=\"https://styleci.io/repos/94527137/shield?branch=master\" alt=\"StyleCI Status\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/lasserafn/php-hexer\"\u003e\u003cimg src=\"https://img.shields.io/packagist/dt/lasserafn/php-hexer.svg?style=flat-square\" alt=\"Total Downloads\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/lasserafn/php-hexer\"\u003e\u003cimg src=\"https://img.shields.io/packagist/v/lasserafn/php-hexer.svg?style=flat-square\" alt=\"Latest Stable Version\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/lasserafn/php-hexer\"\u003e\u003cimg src=\"https://img.shields.io/packagist/l/lasserafn/php-hexer.svg?style=flat-square\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Installation\n\nYou just require using composer and you're good to go!\n\n```bash\ncomposer require lasserafn/php-hexer\n```\n\n## Usage\n\nAs with installation, usage is quite simple. \n\n```php\nuse LasseRafn\\Hexer\\Hex;\n\n// Lighten\n$hex = new Hex('#333'); // You can leave out the hashtag if you wish.\necho $hex-\u003elighten(15); // Output: #595959 (if you left out the hashtag, it would not be included in the output either)\n\n// Darken\n$hex = new Hex('ffffff');\necho $hex-\u003edarken(15); // Output: d9d9d9\n\n// To RGB\n$hex = new Hex('007F00');\n$hex-\u003elighten(50)-\u003etoRgb(); // Returns: ['r' =\u003e 128, 'g' =\u003e 255, 'b' =\u003e 128]\n```\n\n## Methods\n\nThe constructor accepts one parameter (`hex`) which can optionally contain a hashtag (#). The length has to be between 3-6 characters (without the hashtag).\n\n### `lighten($percentage)`\n\nWill lighten the color by X percentage. Percentage must be between 0-100. An exception will be thrown otherwise.\n\n### `darken($percentage)`\n\nWill darken the color by X percentage. Percentage must be between 0-100. An exception will be thrown otherwise.\n\n### `toRgb()`\n\nWill return the hex as RGB (an array of `r`, `g`, `b`).\n\n## Exceptions\n\nIf you input a HEX which is less than 3 characters of length, or greater than 6, an exception will be thrown. Similar with percentages, if you specify a percentage less than zero, or greater than 100, an exception will be thrown. If the percentage *is* zero, the hex itself will simply be returned.\n\n## Requirements\n* PHP 5.6, 7.0 or 7.1\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flasserafn%2Fphp-hexer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flasserafn%2Fphp-hexer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flasserafn%2Fphp-hexer/lists"}