dot-get_alpha_from_hex_colour: Extract the numerical alpha representation of #RRGGBBAA...

.get_alpha_from_hex_colourR Documentation

Extract the numerical alpha representation of #RRGGBBAA colour

Description

RGB colours can be encoded as hexadecimal values, as for example internally used by ggplot2. For this, the numerical RGB values are mapped from their 0-255 value range to two-character hex-values. This yields a string in the form of '#RRGGBB'. Additionally, a fourth optional block can be present encoding the alpha transparency of the colour. This extends the string to '#RRGGBBAA'. This function takes such a string as input for hex_colour, extracts the 'AA' part and returns the numerical representation if it.

Usage

.get_alpha_from_hex_colour(hex_colour = NULL)

Arguments

hex_colour

A string in the format '#RRGGBBAA'

Value

The numeric representation of the colors' alpha value, rounded to 2 digits.


visR documentation built on May 29, 2024, 11:50 a.m.