{"id":17922756,"url":"https://github.com/overtrue/bash-color","last_synced_at":"2025-03-24T02:32:50.177Z","repository":{"id":35149223,"uuid":"39376246","full_name":"overtrue/bash-color","owner":"overtrue","description":"Generate command line colorized text.","archived":true,"fork":false,"pushed_at":"2019-04-06T08:05:55.000Z","size":18,"stargazers_count":12,"open_issues_count":2,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-19T01:11:15.305Z","etag":null,"topics":[],"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/overtrue.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":"2015-07-20T09:55:04.000Z","updated_at":"2025-03-14T14:29:11.000Z","dependencies_parsed_at":"2022-09-16T15:01:38.030Z","dependency_job_id":null,"html_url":"https://github.com/overtrue/bash-color","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overtrue%2Fbash-color","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overtrue%2Fbash-color/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overtrue%2Fbash-color/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overtrue%2Fbash-color/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/overtrue","download_url":"https://codeload.github.com/overtrue/bash-color/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245198773,"owners_count":20576443,"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-10-28T20:40:44.492Z","updated_at":"2025-03-24T02:32:49.866Z","avatar_url":"https://github.com/overtrue.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BashColor\nGenerate command line colorized text. 给命令行文字添加前景/背景色、以及修饰效果。\n\n[![Build Status](https://travis-ci.org/overtrue/bash-color.svg?branch=master)](https://travis-ci.org/overtrue/bash-color)\n[![Latest Stable Version](https://poser.pugx.org/overtrue/bash-color/v/stable.svg)](https://packagist.org/packages/overtrue/bash-color)\n[![Latest Unstable Version](https://poser.pugx.org/overtrue/bash-color/v/unstable.svg)](https://packagist.org/packages/overtrue/bash-color)\n[![Code Coverage](https://scrutinizer-ci.com/g/overtrue/bash-color/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/overtrue/bash-color/?branch=master)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/overtrue/bash-color/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/overtrue/bash-color/?branch=master)\n[![Total Downloads](https://poser.pugx.org/overtrue/bash-color/downloads)](https://packagist.org/packages/overtrue/bash-color)\n[![License](https://poser.pugx.org/overtrue/bash-color/license)](https://packagist.org/packages/overtrue/bash-color)\n\n# Installing\n\n```shell\n$ composer require \"overtrue/bash-color\"\n```\n\n# Usage\n\n```php\nuse Overtrue\\BashColor\\BashColor;\n\necho BashColor::render('\u003cfg=green\u003eAre you sure ?\u003c/\u003e\u003cfg=yellow\u003e [Y/n]:\u003c/\u003e'), \"\\n\";\necho BashColor::render('\u003cbg=purple;\u003ehello world!\u003c/\u003e'), \"\\n\";\necho BashColor::render('\u003cfg=green;opt=bold\u003eyes!\u003c/\u003e'), \"\\n\";\necho BashColor::render('\u003cfg=cyan;opt=bold;bg=red\u003eugly!\u003c/\u003e'), \"\\n\";\n\n```\nresult:\n\n![qq20150822-1 2x](https://cloud.githubusercontent.com/assets/1472352/9413936/9decd54a-4867-11e5-8d0b-1d27da954cc3.jpg)\n\n### Attributes\n\n- `fg` foreground color.\n- `bg` background color.\n- `opt` option.\n\n### foreground\n\n```\n'default'       // Default (usually green, white or light gray)\n'black'         // Black\n'red'           // Red (don't use with green background)\n'green'         // Green\n'yellow'        // Yellow\n'blue'          // Blue\n'magenta'       // Magenta/Purple\n'purple'        // Magenta/Purple\n'cyan'          // Cyan\n'light_gray'    // Light Gray\n'dark_gray'     // Dark Gray\n'light_red'     // Light Red\n'light_green'   // Light Green\n'light_yellow'  // Light Yellow\n'light_blue'    // Light Blue\n'light_magenta' // Light Magenta/pink\n'light_pink'    // Light Magenta/pink\n'light_cyan'    // Light Cyan\n'white'         // White\n```\n### background\n\n```\n'default'       // Default background color (usually black or blue)\n'black'         // Black\n'red'           // Red\n'green'         // Green\n'yellow'        // Yellow\n'blue'          // Blue\n'magenta'       // Magenta/Purple\n'PURPLE'        // Magenta/Purple\n'cyan'          // Cyan\n'light_gray'    // Light Gray (don't use with white foreground)\n'dark_gray'     // Dark Gray (don't use with black foreground)\n'light_red'     // Light Red\n'light_green'   // Light Green (don't use with white foreground)\n'light_yellow'  // Light Yellow (don't use with white foreground)\n'light_blue'    // Light Blue (don't use with light yellow foreground)\n'light_magenta' // Light Magenta/Pink (don't use with light foreground)\n'light_cyan'    // Light Cyan (don't use with white foreground)\n'white'         // White (don't use with light foreground)\n```\n\n### options\n\n```\n'none'       // Reset/Remove all option\n'bold'       // Bold/Bright\n'bright'     // Bold/Bright\n'dim'        // Dim\n'underlined' // Underlined\n'blink'      // Blink\n'reverse'    // Reverse/invert\n'invert'     // Reverse/invert\n'hidden'     // Hidden\n```\n\n# Reference\n\n[Bash tips: Colors and formatting](http://misc.flogisoft.com/bash/tip_colors_and_formatting)\n\n## PHP 扩展包开发\n\n\u003e 想知道如何从零开始构建 PHP 扩展包？\n\u003e\n\u003e 请关注我的实战课程，我会在此课程中分享一些扩展开发经验 —— [《PHP 扩展包实战教程 - 从入门到发布》](https://learnku.com/courses/creating-package)\n\n# License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fovertrue%2Fbash-color","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fovertrue%2Fbash-color","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fovertrue%2Fbash-color/lists"}