@@ -123,6 +123,12 @@ composer require macocci7/bash-colorizer
123123 ->echo("Hi, there!", PHP_EOL);
124124 ```
125125
126+ by hex code:
127+ ```php
128+ Colorizer::foreground('#ffcc00') // or #fc0
129+ ->echo("Hi, there!", PHP_EOL);
130+ ```
131+
126132 by number [0 - 255] (256 colors):
127133 ```php
128134 Colorizer::foreground(2)
@@ -145,6 +151,12 @@ composer require macocci7/bash-colorizer
145151 ->echo("Hi, there!", PHP_EOL);
146152 ```
147153
154+ by hex code:
155+ ```php
156+ Colorizer::background("#ffcc00") // or #fc0
157+ ->echo("Hi, there!", PHP_EOL);
158+ ```
159+
148160 by number [0 - 255] (256 colors):
149161 ```php
150162 Colorizer::background(1)
@@ -168,6 +180,28 @@ composer require macocci7/bash-colorizer
168180 ->echo("Hi, there!", PHP_EOL);
169181 ```
170182
183+ - Setting underline color:
184+
185+ by hex code:
186+ ```php
187+ Colorizer::underline("#ffcc00") // or #fc0
188+ ->echo("Hi, there!", PHP_EOL);
189+ ```
190+
191+ by number [0 - 255] (256 colors):
192+ ```php
193+ Colorizer::underline(1)
194+ ->echo("Hi, there!", PHP_EOL);
195+ ```
196+
197+ by (RGB) array (24bit 16777216 colors):
198+ ```php
199+ Colorizer::underline([255, 0, 0])
200+ ->echo("Hi, there!", PHP_EOL);
201+ ```
202+
203+ See more: [Available Colors](#63-available-colors)
204+
171205- Returning colorized string:
172206
173207 As an argument of echo:
@@ -223,22 +257,34 @@ composer require macocci7/bash-colorizer
223257|`no-italic`|〇|〇|
224258|`no-underline`|〇|〇|
225259|`no-blink`|ー<br ><a href =" #note3" >*3</a >|〇<br ><a href =" #note4" >*4</a >|
260+ |`proportional-spacing`|ー|ー|
226261|`no-reverse`|〇|〇|
227262|`no-conceal`|〇|〇|
228263|`no-strike`|〇|〇|
264+ |`no-proportional-spacing`|ー|ー|
265+ |`framed`|❌|❌|
266+ |`encircled`|❌|❌|
267+ |`overlined`|〇|〇|
268+ |`no-framed-no-encircled`|ー<br ><a href =" #note3" >*3</a >|ー<br ><a href =" #note3" >*3</a >|
269+ |`no-overlined`|〇|〇|
270+ |`underline-color`|〇|▲<br ><a href =" #note5" >*5</a >|
229271
230272> <a id =" note1" ></a >
231273*1: No effect with `faint`<br >
232274> <a id =" note2" ></a >
233275*2: Not `fast` (blinks at the same rate as `blink`)<br >
234276> <a id =" note3" ></a >
235- *3: Unknown because `blink` has no effect<br >
277+ *3: Unknown because the corresponding attribute has no effect<br >
236278> <a id =" note4" ></a >
237279*4: Also effective against `fast-blink`<br >
280+ > <a id =" note5" ></a >
281+ *5: Partially effective<br >
238282
239283e.g.) on VSCode Terminal
240284
241- <img src =" arts/available_attributes.png" width =" 180" height =" 360" />
285+ <img src =" arts/available_attributes.png" width =" 220" height =" 515" />
286+
287+ See more: [Select Graphic Rendition parameters | ANSI escape code | Wikipedia](https://en.wikipedia.org/wiki/ANSI_escape_code#Select_Graphic_Rendition_parameters)
242288
243289### 6.3. Available Colors
244290
@@ -261,7 +307,7 @@ e.g.) on VSCode Terminal
261307 |---|---|
262308 |<img src =" arts/available_foreground_colors.png" with =" 240" height =" 216" />|<img src =" arts/available_background_colors.png" with =" 240" height =" 216" />|
263309
264- - 256 colors [ 0 - 255 ]:
310+ - 256 colors [ 0 - 255 ]: `foreground`/`background`/`underline`
265311
266312 e.g.) foreground colors on VSCode Terminal:
267313
@@ -271,6 +317,10 @@ e.g.) on VSCode Terminal
271317
272318 <img src =" arts/background_256colors.png" width =" 500" height =" 256" />
273319
320+ e.g.) underline colors on VSCode Terminal:
321+
322+ <img src =" arts/underline_256colors.png" width =" 500" height =" 252" />
323+
274324- 24bit (16777216) colors:
275325
276326 e.g.) foreground colors on VSCode Terminal:
@@ -281,6 +331,10 @@ e.g.) on VSCode Terminal
281331
282332 <img src =" arts/background_24bitcolors.png" width =" 500" height =" 406" />
283333
334+ e.g.) underline colors on VSCode Terminal:
335+
336+ <img src =" arts/underline_24bitcolors.png" width =" 500" height =" 410" />
337+
284338## 7. Examples
285339
286340Example codes are in [playground](playground/) directory.
@@ -293,6 +347,8 @@ Example codes are in [playground](playground/) directory.
293347- [foreground_24bitcolors.php](playground/foreground_24bitcolors.php)
294348- [background_256colors.php](playground/background_256colors.php)
295349- [background_24bitcolors.php](playground/background_24bitcolors.php)
350+ - [underline_256colors.php](playground/underline_256colors.php)
351+ - [underline_24bitcolors.php](playground/underline_24bitcolors.php)
296352- [readable.php](playground/readable.php)
297353
298354## 8. LICENSE
0 commit comments