Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bvanhoekelen/terminal-style
🎨 Return your terminal message in style! Change the text style, text color and text background color from the terminal, console or shell interface with ANSI color codes. Support for Laravel and Composer.
https://github.com/bvanhoekelen/terminal-style
ansi bash color command-line command-line-tool php style terminal
Last synced: 2 months ago
JSON representation
🎨 Return your terminal message in style! Change the text style, text color and text background color from the terminal, console or shell interface with ANSI color codes. Support for Laravel and Composer.
- Host: GitHub
- URL: https://github.com/bvanhoekelen/terminal-style
- Owner: bvanhoekelen
- License: apache-2.0
- Created: 2017-04-20T16:17:04.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-01-31T17:59:22.000Z (almost 5 years ago)
- Last Synced: 2024-10-14T22:09:24.443Z (3 months ago)
- Topics: ansi, bash, color, command-line, command-line-tool, php, style, terminal
- Language: PHP
- Homepage:
- Size: 1.72 MB
- Stars: 19
- Watchers: 1
- Forks: 11
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP Terminal style
[![Hex.pm](https://img.shields.io/hexpm/l/plug.svg?maxAge=2592000&style=flat-square)](https://github.com/bvanhoekelen/terminal-style/blob/master/LICENSE)
[![GitHub release](https://img.shields.io/github/release/bvanhoekelen/terminal-style.svg?style=flat-square)](https://github.com/bvanhoekelen/terminal-style/releases)
[![Packagist](https://img.shields.io/packagist/dt/bvanhoekelen/terminal-style.svg?style=flat-square)](https://packagist.org/packages/bvanhoekelen/terminal-style)
[![Github issues](https://img.shields.io/github/issues/bvanhoekelen/terminal-style.svg?style=flat-square)](https://github.com/bvanhoekelen/terminal-style/issues)## Highlight
- The easiest way to style your text in the command line / terminal
- Change text color to red, green, yellow ... » [Text color](#text-color)
- Change background color to red, green, yellow ... » [Background color](#background-color)
- Change background in customer 8-bit color » [Custom background color](https://github.com/bvanhoekelen/terminal-style/wiki/style-%C2%BB-custom-background)
- Change text style to bold, dim, underlined, blink ... » [Text style](#text-style)
- Support for Laravel framework » [Laravel](https://laravel.com)
- Easy to install » [installation](#installation)
- Love feedback » [backlog](https://github.com/bvanhoekelen/terminal-style/blob/master/BACKLOG.md) or [create issues](https://github.com/bvanhoekelen/terminal-style/issues)## How to use
```php
echo terminal_style($message = null, $color = null, $background = null, $style = null);
```## Text color
### Code example
```php
// Print red text
echo terminal_style('Here your text', 'red');
```
### Text color names
Use can use: `default`, `yellow`, `red`, `green`, `light-gray` [...](https://github.com/bvanhoekelen/terminal-style/wiki/style-%C2%BB-text-color-names)See [the full color name list here](https://github.com/bvanhoekelen/terminal-style/wiki/style-%C2%BB-text-color-names)
## Background color
### Code example
```php
// Print text with background red
echo terminal_style('Here your text', null, 'red');
```
### Background colors names
Use can use: `default`, `yellow`, `red`, `green`, `light-gray` [...](https://github.com/bvanhoekelen/terminal-style/wiki/style-%C2%BB-background-color-names)See [the full background color name list here](https://github.com/bvanhoekelen/terminal-style/wiki/style-%C2%BB-background-color-names) or see [custom background color](https://github.com/bvanhoekelen/terminal-style/wiki/style-%C2%BB-custom-background)
## Text style
### Code example
```php
// Print text style bold
echo terminal_style('Here your text', null, null, 'bold');
```
### Text stylesUse can use: `default`, `bold `, `dim`, `italic`, `underlined`, 'blink' [...](https://github.com/bvanhoekelen/terminal-style/wiki/style-%C2%BB-text-style-names)
See [the full text style name list here](https://github.com/bvanhoekelen/terminal-style/wiki/style-%C2%BB-text-style-names)
# Help, docs and links
- [Wiki](https://github.com/bvanhoekelen/terminal-style/wiki)
- [Backlog](https://github.com/bvanhoekelen/terminal-style/blob/master/BACKLOG.md)
- [Change log](https://github.com/bvanhoekelen/terminal-style/blob/master/CHANGELOG.md)
- [Packagist](https://packagist.org/packages/bvanhoekelen/terminal-style)## Backlog & Feedback
If you have any suggestions to improve this php terminal style tool? Please add your feature, bug or improvement to the [BACKLOG.dm](https://github.com/bvanhoekelen/terminal-style/blob/master/BACKLOG.md). Or create a [issues](https://github.com/bvanhoekelen/terminal-style/issues).
- [Open backlog](https://github.com/bvanhoekelen/terminal-style/blob/master/BACKLOG.md)
- [Create issues](https://github.com/bvanhoekelen/terminal-style/issues)# Installation
## Install with Laravel
Get PHP terminal style tool by running the Composer command in the command line.
```{r, engine='bash', count_lines}
$ composer require bvanhoekelen/terminal-style
```Open your file and use `terminal_style()`
```php
// Print red text
echo terminal_style('Here your text', 'red');```
## Install with composer
Get PHP terminal style tool by running the Composer command in the command line.
```{r, engine='bash', count_lines}
$ composer require bvanhoekelen/terminal-style
```Open your file and use `terminal_style()`
```php
// Require vender autoload
require_once('../vendor/autoload.php');// Print red text
echo terminal_style('Here your text', 'red');```
## Overview
## Custom background
See [custom background color](https://github.com/bvanhoekelen/terminal-style/wiki/style-%C2%BB-custom-background)