Now if you absolutely wished to use materials with names as they were spelled in the SVG file, then you can call the get_safe_color() method from another method:
def make_svg_material(name, matls = Sketchup.active_model.materials)
matl = matls.add(name)
matl.color= get_safe_color(name)
# set any other material properties here
return matl
end