clean_colors: Cleans and returns color palette.

View source: R/colors.R

clean_colorsR Documentation

Cleans and returns color palette.

Description

Cleans color palette object for use by run_hourglass function.

Usage

clean_colors(pal, to_remove = "#ffffffff", is_df = T)

Arguments

pal

Either 1) Data frame, where column 1 is variables and column 2 is hex codes, 2) List object indicating color palette, where elements are hex codes and element names are variables. e.g. list("Tissue.type-Tumour"="#2f4f4Fff", "Tissue.type-Stroma"="#d2691eff")

to_remove

Vector of hex codes to remove from palette, default is white ("#ffffffff"(,)

is_df

Boolean. Is the "pal" value a data frame object?

Value

List of colors, where elements are hex codes and element names are variables. As a result of "cleaning", element names don't have 2 parts, are duplicated, and is white e.g. list("Tumour"="#2f4f4Fff", "Stroma"="#d2691eff")


kazeera/hourglass documentation built on April 5, 2025, 7:18 a.m.