vectorized make_styles for html span output
Usage
make_html_styles(
style = NULL,
text,
bg = FALSE,
bg_style = NULL,
grey = FALSE,
Cgrey = getOption("jam.Cgrey"),
lightMode = NULL,
Crange = getOption("jam.Crange"),
Lrange = getOption("jam.Lrange"),
adjustRgb = getOption("jam.adjustRgb"),
adjustPower = 1.5,
fixYellow = TRUE,
alphaPower = 2,
setOptions = FALSE,
verbose = FALSE,
...
)
Arguments
- style
character
vector of one or more styles. WhenNULL
orNA
, no style is applied, except whenbg_style
is supplied and is neitherNA
norNULL
, in which case entries with abg_style
and nostyle
will usesetTextContrastColor()
to define a contrastingstyle
.- text
character
vector (or coerced tocharacter
) of one or more values,.- bg
logical
indicating whether thestyle
should be applied to the background instead of foreground. This argument is ignored whenbg_style
is supplied.- bg_style
NULL
or acharacter
vector of one or more background styles. When this argument is not NULL, it applies both the foregroundstyle
and backgroundbg_style
together, and therefore ignoresCrange
andLrange
settings.- grey
logical
, default FALSE, whether to use greyscale.- Cgrey
numeric
chroma (C) value, which defines grey colors at or below this chroma. Any colors at or below the grey cutoff will have use ANSI greyscale coloring. To disable, setCgrey=-1
.- lightMode
logical
indicating whether the background color is light (TRUE is bright), or dark (FALSE is dark.) By default it callscheckLightMode()
which queriesgetOption("lightMode")
.- Crange
numeric
range of chroma values, ranging between 0 and 100. When NULL, default values will be assigned to Crange. When supplied, range(Crange) is used.- Lrange
numeric
range of luminance values, ranging between 0 and 100. When NULL, default values will be assigned to Lrange. When supplied, range(Lrange) is used.- adjustRgb
numeric
value adjustment used during the conversion of RGB colors to ANSI colors, which is inherently lossy. If not defined, it uses the default returned bysetCLranges()
which itself usesgetOption("jam.adjustRgb")
with default=0. In order to boost color contrast, an alternate value of -0.1 is suggested.- adjustPower
numeric
adjustment power factor- fixYellow
logical
indicating whether to "fix" the darkening of yellow, which otherwise turns to green. Instead, since JAM can, JAM will make the yellow slightly more golden before darkening. This change only affects color hues between 80 and 90. This argument is passed toapplyCLrange()
.- alphaPower
numeric
value, used to adjust the RGB values for alpha values less than 255, by raising the ratio to 1/alphaPower, which takes the ratio of square roots. alphaPower=100 for minimal adjustment.- setOptions
character
orlogical
whether to updateCrange
andLrange
options during the subsequent call tosetCLranges()
. By default,"ifnull"
will update only options which were previouslyNULL
;"FALSE"
prevents modifying the global options;"TRUE"
will update these options with the current values.
- verbose
logical
indicating whether to print verbose output- ...
additional parameters are ignored
Value
character
vector with the same length as text
input vector,
where entries are surrounded by the relevant HTML consistent with
the style
defined at input. In short, a character vector as input,
colorized HTML character vector as output.
See also
Other jam internal functions:
handleArgsText()
,
jamCalcDensity()
,
make_styles()
,
smoothScatterJam()