Não tenho certeza do que você está tentando alcançar, mas se sua função interagir de alguma forma com o portage, talvez você possa usar sua definição de cor. De man 5 color.map
:
VARIABLES
NORMAL = "normal"
Defines color used for some words occuring in other contexts than those
below.
BAD = "red"
Defines color used for some words occuring in bad context.
BRACKET = "blue"
Defines color used for brackets.
GOOD = "green"
Defines color used for some words occuring in good context.
HILITE = "teal"
Defines color used for highlighted words.
INFORM = "darkgreen"
Defines color used for informational words.
[...]
SECURITY_WARN = "red"
Defines color used for security warnings.
UNMERGE_WARN = "red"
Defines color used for unmerge warnings.
WARN = "yellow"
Defines color used for warnings.