Learn R Programming

swatches (version 0.5.0)

read_soc: Read colors from OpenOffice Palette (SOC) files

Description

Given a path or URL to an .soc file, this function will return a named character vector (if color names are present) of hex RGB colors.

Usage

read_soc(path, use_names = TRUE, .verbose = FALSE)

Arguments

path

partial or full file path or URL to a GPL file

use_names

add color names to the vector (defaults to TRUE). See NOTE

.verbose

show extra information about GPL file processing

Examples

Run this code
# NOT RUN {
# built-in palette
soc_file <- system.file("palettes", "ccooo.soc", package="swatches")
system(sprintf("cat %s", soc_file))
ccooo <- read_soc(soc_file)
print(ccooo)
show_palette(ccooo)

# from the internet directly
# }
# NOT RUN {
galaxy <- read_soc("https://www.openoffice.org/ui/VisualDesign/docs/colors/galaxy.soc")
print(galaxy)
show_palette(galaxy)
# }

Run the code above in your browser using DataLab