col2bg: Convert an R colour to a 216-colour ANSI string. Suitable for...

Description Usage Arguments Details Value

View source: R/ansi-escape-codes.R

Description

Ref: https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit

Usage

1
2
3
4
5
col2bg(rcolour)

col2fg(rcolour)

col2code(rcolour)

Arguments

rcolour

any R colour e.g. 'red', '#445566'

Details

If all the RGB colour components are equal then the colour is matched to one of 24 grey levels, other wise it is converted to one of 216 standard colours.

Value

ANSI escape string for the given colour as a foreground or background colour


coolbutuseless/ransid documentation built on Oct. 16, 2020, 5:06 p.m.