i want to transform these RGB values into a column with their respective names

is there any way to transform the RGB values into a column with their respective names?

72e50326-3d8e-46f5-bb61-9d300bf8d1df

Hello @liazi
It should be a simple task in R / Py. Can you code?

This is a ‘R Snipet’ node’s coding example:

library(plotrix)

knime.out <- knime.in

r <- knime.in$"R"
g <- knime.in$"G"
b <- knime.in$"B"
a <- knime.in$"A"

knime.out$RGB_hex <- rgb(r, g, b, maxColorValue = a)
knime.out$RGB_name <- sapply(knime.out$RGB_hex, color.id)

BR

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.