{"id":16409535,"url":"https://github.com/pointybeard/helpers-cli-colour","last_synced_at":"2025-02-24T02:26:15.858Z","repository":{"id":57043209,"uuid":"184991386","full_name":"pointybeard/helpers-cli-colour","owner":"pointybeard","description":"Provides colour constants and a simple way to colourise strings for use on the command-line.","archived":false,"fork":false,"pushed_at":"2019-05-05T10:11:54.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-06T11:42:00.559Z","etag":null,"topics":["colourise","command-line","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pointybeard.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-05T06:49:58.000Z","updated_at":"2019-05-05T10:11:49.000Z","dependencies_parsed_at":"2022-08-24T01:21:06.146Z","dependency_job_id":null,"html_url":"https://github.com/pointybeard/helpers-cli-colour","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pointybeard%2Fhelpers-cli-colour","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pointybeard%2Fhelpers-cli-colour/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pointybeard%2Fhelpers-cli-colour/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pointybeard%2Fhelpers-cli-colour/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pointybeard","download_url":"https://codeload.github.com/pointybeard/helpers-cli-colour/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240405436,"owners_count":19796189,"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":["colourise","command-line","php"],"created_at":"2024-10-11T06:20:20.147Z","updated_at":"2025-02-24T02:26:15.829Z","avatar_url":"https://github.com/pointybeard.png","language":"PHP","readme":"# PHP Helpers: Command-line Colour\n\n-   Version: v1.0.2\n-   Date: May 05 2019\n-   [Release notes](https://github.com/pointybeard/helpers-cli-colour/blob/master/CHANGELOG.md)\n-   [GitHub repository](https://github.com/pointybeard/helpers-cli-colour)\n\nProvides colour constants and a simple way to colourise strings for use on the command-line.\n\n## Installation\n\nThis library is installed via [Composer](http://getcomposer.org/). To install, use `composer require pointybeard/helpers-cli-colour` or add `\"pointybeard/helpers-cli-colour\": \"~1.0\"` to your `composer.json` file.\n\nAnd run composer to update your dependencies:\n\n    $ curl -s http://getcomposer.org/installer | php\n    $ php composer.phar update\n\n### Requirements\n\nThere are no particuar requirements for this library other than PHP 5.6 or greater.\n\nTo include all the [PHP Helpers](https://github.com/pointybeard/helpers) packages on your project, use `composer require pointybeard/helpers` or add `\"pointybeard/helpers\": \"~1.0\"` to your composer file.\n\n## Usage\n\nHere is an example of how to use the Colour class:\n\n```php\n\u003c?php\n\ninclude __DIR__ . \"/vendor/autoload.php\";\n\nuse pointybeard\\Helpers\\Cli\\Colour;\n\n// Access colour constants\n$foreground = Colour\\Colour::FG_RED;\n$background = Colour\\Colour::BG_LIGHT_YELLOW;\n\ntry{\n\n    // Add colour to a string\n    print Colour\\Colour::colourise(\n        \"This is my colouful string!!\",\n        $foreground,\n        $background\n    );\n\n    print PHP_EOL;\n\n    // Throws a InvalidColourException exception if the colour is invalid\n    Colour\\Colour::colourise(\n        \"Some string\",\n        \"banana\",\n        $background\n    );\n\n} catch (Colour\\Exceptions\\InvalidColourException $ex) {\n    print \"ERROR: \" . $ex-\u003egetMessage() . PHP_EOL;\n}\n\n```\n\n### Colours\n\nThe following colour constants exist:\n\n#### Foreground\nFG_DEFAULT, FG_BLACK, FG_RED, FG_GREEN, FG_BROWN, FG_BLUE, FG_PURPLE, FG_CYAN, FG_WHITE, FG_DARK_GRAY, FG_LIGHT_RED, FG_LIGHT_GREEN, FG_YELLOW, FG_LIGHT_BLUE, FG_LIGHT_PURPLE, FG_LIGHT_CYAN, FG_LIGHT_GRAY\n\n#### Background\nBG_BLACK, BG_RED, BG_GREEN, BG_YELLOW, BG_BLUE, BG_MAGENTA, BG_CYAN, BG_DEFAULT, BG_WHITE, BG_LIGHT_GRAY, BG_LIGHT_RED, BG_LIGHT_GREEN, BG_LIGHT_YELLOW, BG_LIGHT_BLUE, BG_LIGHT_MAGENTA, BG_LIGHT_CYAN, BG_DARK_GRAY\n\n## Support\n\nIf you believe you have found a bug, please report it using the [GitHub issue tracker](https://github.com/pointybeard/helpers-cli-colour/issues),\nor better yet, fork the library and submit a pull request.\n\n## Contributing\n\nWe encourage you to contribute to this project. Please check out the [Contributing documentation](https://github.com/pointybeard/helpers-cli-colour/blob/master/CONTRIBUTING.md) for guidelines about how to get involved.\n\n## License\n\n\"PHP Helpers: Command-line Colour\" is released under the [MIT License](http://www.opensource.org/licenses/MIT).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpointybeard%2Fhelpers-cli-colour","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpointybeard%2Fhelpers-cli-colour","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpointybeard%2Fhelpers-cli-colour/lists"}