R/get_closest_color.R

Defines functions get_closest_color

# get closest colour using RGB format
get_closest_color <- function(o_vec, pal) {
  t_mat <- pal_collection[[pal]] / 255
  index <- which.min(apply(t_mat, 1, color_dist, b_vec = o_vec))[1]
  t_mat[index,]
}
TengMCing/im2pix documentation built on Feb. 2, 2021, 11:43 a.m.