If you have all the possible tint colors in the TileSet already, than you can use the TileMaps get_used_cells
function to retrieve and the used cells and set_cell
to set the tile
you want from the TileSet.
You can also create the tint colors dynamically, using TileSets create_tile
method
Example (TileMap's script):
extends TileMap
func _ready():
for c in get_used_cells():
x, y = ...
tile_id = 100 + x + 1000*y #probably should not conflict with existing tiles
get_tileset().create_tile(tile_id)
get_tileset().tile_set_material(tile_id, ...)
set_cell (x, y, tile_id )
Not sure how to get cell's x and y though...