Create a lol object to pass to lolcat and friends
new()Create a new lol engine
lol$new(rate = 0.02, angle = pi/4, aspect = 3, palette = NULL)
rateThe rate of colour progression in terms of fraction
of the colour palette per horizontal line when angle = 0.
Increasing values give increasing rate of colour change.
angleThe angle of the colour change. 0 is horizontal
lines only, pi / 4 (the default) runs the gradient top-left
to bottom-right, pi / 2 changes across columns and so on.
Any numeric value is allowed.
aspectThe assumed aspect ratio of rows to columns (used
in the treatment of angle).
paletteThe colour palette to use. This should be a vector of hex colours that "wrap". We will interpolate along this vector to select a colour for the output. The default is a rainbow set of colours.
render()Render text in colour
lol$render(text, reset = TRUE)
textCharacter vector to render
resetReset the column on return (i.e, assume text is followed by a newline)
render_line()Render a single line (i.e., single string) in colour
lol$render_line(text, reset = TRUE)
textSingle string to render
resetReset the column on return (i.e, assume text is followed by a newline)
set_as_default()Set this object as the package default
lol$set_as_default()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.