col2kml: Convert a color strings to the KML format

Description Usage Arguments Value Author(s) See Also Examples

View source: R/col2kml.R

Description

Converts some common color formats (internal R colors, hexadecimal format, Munsell color codes) color to KML format.

Usage

1
col2kml(colour)

Arguments

colour

R color string

Value

KML-formatted color as \#aabbggrr where aa=alpha (00 to ff), bb=blue (00 to ff), gg=green (00 to ff), rr=red (00 to ff).

Author(s)

Pierre Roudier, Tomislav Hengl and Dylan Beaudette

See Also

aqp::munsell2rgb

Examples

1
2
3
4
5
col2kml("white")
col2kml(colors()[2])
hex2kml(rgb(1,1,1))
x <- munsell2kml("10YR", "2", "4")
kml2hex(x)

Example output

plotKML version 0.5-8 (2017-05-12)
URL: http://plotkml.r-forge.r-project.org/
[1] "#ffffffff"
[1] "#fffff8f0"
[1] "#ffffffff"
[1] "#6F5F4CFF"
Warning message:
system call failed: Cannot allocate memory 

plotKML documentation built on April 27, 2021, 3:01 p.m.