class Lutaml::Model::ComparableModel::DiffContext

def colorize(text, color)

Returns:
  • (String) - The colored text

Parameters:
  • color (Symbol) -- The color to apply
  • text (String) -- The text to color
def colorize(text, color)
  return text unless @use_colors
  color_codes = { red: 31, green: 32, blue: 34 }
  "\e[#{color_codes[color]}m#{text}\e[0m"
end