I'm trying to replace colors in a texture. This works for flat colors, but it has to be an EXACT match. is there any way I can try and implement a sort of tolerance system, similar to how paint buckets work?
foreach (var cPP in ColorReplacementPairs)
{
for (var index = 0; index < colors.Length; index++)
{
var col = colors[index];
if (col != cPP.ColorToReplace)
{
continue;
}
colors[index] = cPP.ReplacementColor;
// Debug.Log("COLOR HAS BEEN REPLACED!");
}
}