Skip to main content

Posts

Showing posts with the label command line

How to use Colors in the Command Line output with PHP

Here is a simple function you can copy into your php file and it will format whatever section of text you place in it with a certain background and foreground color. <?php function colorFormatText ( $string , $textColor , $bgColor ) { return chr ( 27 ) . "[" . $textColor . "m" . chr ( 27 ) . "[" . $bgColor . "m" . $string . chr ( 27 ) . "[0m" ; } ?> The Colors Here is a list of the colors available using this method. There are only 8 colors. Text Background Color 30 40 Black 31 41 Red 32 42 Green 33 43 Yellow 34 44 Dark Blue 35 45 Pink 36 46 Light Blue 37 47 White

Ascii Art

There are a variety of different ways that you can convert an image to ASCII. If you are a 3l31t3 uber geek and love the command line there is a utility called jp2a. If you run a posix complaint os like Linux, Mac etc there are ports to install the application from. Then at the command line you can jp2a yourimage.jpg For those who would still like to try this but would rather a fun browser based GUI with all the wonderous mouse clicky stuff. Take a whiff of this cool website. http://picascii.com/ ```````````````` `.,,,,';;;;;;;;;;;::...`:;;;;;;::;..:,`.`.`.....`, ``````` .,,.,:;;;;';;;;;;:``.,;;;;;;;;';:;;,;:` ,,,........ ``` `,,:::';;;;;;;;;;; ,:;;;;:;;;;;;;;'',,:,:``...,,...: .,,:::';;;;;;;;;;:;,;;;;;;,,.:;;;:,,.,,::,,``.,,,.., .,,,';;;;;;;;;:;:``...