{"id":13623789,"url":"https://github.com/mikeemoo/ColorJizz-PHP","last_synced_at":"2025-04-15T20:32:23.536Z","repository":{"id":3601268,"uuid":"4665700","full_name":"mikeemoo/ColorJizz-PHP","owner":"mikeemoo","description":"ColorJizz is a PHP library for manipulating and converting colors.","archived":false,"fork":false,"pushed_at":"2023-07-07T20:06:31.000Z","size":433,"stargazers_count":290,"open_issues_count":7,"forks_count":32,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-09-06T11:12:27.916Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikeemoo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2012-06-14T16:37:06.000Z","updated_at":"2024-01-17T15:48:39.000Z","dependencies_parsed_at":"2024-01-03T02:22:57.353Z","dependency_job_id":"10dde191-5238-4a46-b6b7-94cc276d9f56","html_url":"https://github.com/mikeemoo/ColorJizz-PHP","commit_stats":{"total_commits":46,"total_committers":8,"mean_commits":5.75,"dds":0.3913043478260869,"last_synced_commit":"361b8a8727d13b67cb593a936a715ad2204ececb"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeemoo%2FColorJizz-PHP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeemoo%2FColorJizz-PHP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeemoo%2FColorJizz-PHP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeemoo%2FColorJizz-PHP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikeemoo","download_url":"https://codeload.github.com/mikeemoo/ColorJizz-PHP/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223684794,"owners_count":17185712,"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-08-01T21:01:35.662Z","updated_at":"2025-04-15T20:32:23.519Z","avatar_url":"https://github.com/mikeemoo.png","language":"PHP","funding_links":[],"categories":["字符串","目录","Table of Contents","PHP","Text and Numbers","字符串( Strings )","Strings","字符串 Strings"],"sub_categories":["字符串 Strings","Strings","Library"],"readme":"# --- I don't pay much attention to this project anymore. If anyone wants ownership - get in contact. ---\n\n\n# Getting started:\n\nColorJizz-PHP uses the PSR-0 standards for namespaces, so there should be no trouble using with frameworks like Symfony 2.\n\n### Autoloading\n\nAn autoloader class is provided for when loading ColorJizz yourself.\n\nFirst, include the autoloader and call the static register() function.\n\n\n```php\n\u003c?php\nrequire_once 'path/to/colorjizz/lib/MischiefCollective/ColorJizz/Autoloader.php';\nMischiefCollective\\ColorJizz\\Autoloader::register();\n?\u003e\n```\n\nNow all ColorJizz classes will be automatically loaded in.\n\n### Converting between formats\n\nColorJizz can convert to and from any of the supported color formats:\n\n```php\n\u003c?php\nuse MischiefCollective\\ColorJizz\\Formats\\Hex;\n\n$red_hex = new Hex(0xFF0000);\n$red_cmyk = $hex-\u003etoCMYK();\n\necho get_class($red_cmyk); // MischiefCollective\\ColorJizz\\Formats\\CMYK\necho $red_cmyk; // 0,1,1,0\n?\u003e\n```\n\nAny color manipulation or conversion will return a new instance of a color class, therefore your original color objects remains intact.\n\nColor manipulation can be chained together:\n\n```php\n\u003c?php\nuse MischiefCollective\\ColorJizz\\Formats\\Hex;\n\necho Hex::fromString('red')-\u003ehue(-20)-\u003egreyscale(); // 555555\n?\u003e\n```\n\nAny color manipulation will always return the color in the same format unless you're specifically converting the format. For example:\n\n```php\n\u003c?php\nuse MischiefCollective\\ColorJizz\\Formats\\RGB;\n\n$red = new RGB(255, 0, 0);\necho get_class($red-\u003ehue(-20)-\u003esaturation(2)); // MischiefCollective\\ColorJizz\\Formats\\RGB\n?\u003e\n```\n\n### Supported formats:\n\n```php\n\u003c?php\nnew RGB(r, g, b);\nnew CMY(c, m, y);\nnew CMYK(c, m, y, k);\nnew Hex(0x000000);\nnew HSV(h, s, v);\nnew CIELab(l, a, b);\nnew CIELCh(l, c, h);\nnew XYZ(x, y, z);\nnew Yxy(Y, x, y);\n```\n\n### Conversion functions:\n\n```php\n\u003c?php\n-\u003etoRGB();\n-\u003etoCMY();\n-\u003etoCMYK();\n-\u003etoHex();\n-\u003etoHSV();\n-\u003etoCIELab();\n-\u003etoCIELCh();\n-\u003etoXYZ();\n-\u003etoYxy();\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikeemoo%2FColorJizz-PHP","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikeemoo%2FColorJizz-PHP","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikeemoo%2FColorJizz-PHP/lists"}