Make material with coluns of excel

hello, I have a table in excel with several columns and a rgb value.
I was wondering if it is possible to create a script that creates in the model all the colors of the table, taking the name and the RGB code.

You can import the excel data into SU. There are several topic here about it:

Once you have imported and, for example, assuming you have a hash of RGB names-values like

rgb_hash = 
  "55-3-Color1-193a" => [162,162,157],
  "Other_color_name" => [1,2,255]

You can do somthing like this:

def create_materials(rgb_hash)
  model = Sketchup.active_model
  materials = model.materials
  rgb_hash.each{|name, value|
    new_material = materials.add(name)
    new_material.color = value
  # If there is already a material with the given name, 
  #  then a new unique name is generated using the given name as a base.