That worked. A quick test made the tile red.
palette_ts.set("0/modulate", Color(255, 0, 0))
FYI, Using palettets.get("0") returns Nil so I can't test that one. I also realized I didn't actually call tileset_texture so I added that as well.
Current code:
palette_ts = TileSet.new()
palette_ts.create_tile(0)
var c = preload("res://Images/palette.png")
palette_ts.tile_set_texture(0, c)
$BG/PaletteArea/Palette.tile_set = palette_ts
palette_ts.set("0/modulate", Color(255, 0, 0))
# palette_ts.get("0").modulate = Color(255, 0, 0, 0)
$BG/PaletteArea/Palette.set_cell(0, 0, 0)
I didn't try the material route. I'm guessing this would be over kill as you would need to make a custom shader for each tile, no? I barely understand shaders so maybe I it would be better to use the material shader instead? If I understand that method, I would do something like:
shader_type canvas_item;
uniform vec4 col : hint_color;
void fragment() {
COLOR = col;
}
Recommendations? What's best, to modulate each color you want or to create a shader and do it that way?