diff --git a/src/Autoload/Palettes.gd b/src/Autoload/Palettes.gd index 236fde980..aee7ff6b2 100644 --- a/src/Autoload/Palettes.gd +++ b/src/Autoload/Palettes.gd @@ -463,9 +463,9 @@ func _import_gpl(path: String, text: String) -> Palette: comments += line.trim_prefix("#") + "\n" # Some programs output palette name in a comment for old format if line.begins_with("#Palette Name: "): - palette_name = line.replace("#Palette Name: ", "") + palette_name = line.replace("#Palette Name: ", "").strip_edges() elif line.begins_with("Name: "): - palette_name = line.replace("Name: ", "") + palette_name = line.replace("Name: ", "").strip_edges() elif line.begins_with("Columns: "): # The width of the palette. line = line.trim_prefix("Columns: ").strip_edges() diff --git a/src/Palette/Palette.gd b/src/Palette/Palette.gd index 5d4a969d7..80c97880c 100644 --- a/src/Palette/Palette.gd +++ b/src/Palette/Palette.gd @@ -7,7 +7,9 @@ const DEFAULT_WIDTH := 8 const DEFAULT_HEIGHT := 8 # Metadata -var name := "Custom Palette" +var name := "Custom Palette": + set(value): + name = value.strip_edges() var comment := "" var path := ""