You can calculate once at beginning of program what color each tile type means. Then it becomes very fast to just use that color table for each map tile. What still remains is refilling the texture when map updates.