I am wondering if it is possible to specify color options when displaying text with the cat
command or a similar command. The reason I ask is because I have set up and interactive feedback system with a simulation I am working on and would like to provide more information to the display as the simulation which takes hours to run is being processed.
Calico cats have at least three colors in their fur, which at their most basic are white, orange, and black. However, variations on these colors, such as cream, blue-black, reddish, brown might also be noted in the coat of a Calico cat.
Generally, the colours, which can be termed differently depending on the breed, are: white, red, blue, black, cream, cinnamon, fawn and brown. The colour of a cat depends completely on genetics. The two primary colours in cats are black and red.
Torbie Cats Of the four type of cat coat colors listed, the torbie cat is most rare.
Genetics are the reason calico tomcats are so rare. Coat color in cats is typically a sex-linked trait—in other words, color is coded into certain chromosomes. 2 Both male and female cats can be orange (a mutant gene) or black because the gene that controls those colors is on the X chromosome.
See this file from the testthat
package for an excellent example on how to create colored text:
https://github.com/hadley/testthat/blob/717b02164def5c1f027d3a20b889dae35428b6d7/R/colour-text.r
You can just use this colourise
function to add color to your text. The file also has a bunch of predefined colors.
EDIT
There is now an R package for ANSI colors on CRAN, it is called crayon
. Disclaimer: I am the package author. http://cran.r-project.org/web/packages/crayon/index.html https://github.com/gaborcsardi/crayon
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With