Color change when passing it to a shader through material.setColorArray

i have this function to pass 2 arrays of colors to a shader.

public void ApplyColor(Palette og_colors, Palette new_colors, SpriteRenderer sprite_rend, Shader shader, Material material)
{
    //apply new_colors to shader

    int len = og_colors.Length();
   
    material.SetColorArray("_OriginalColors", og_colors.GetColors());
    material.SetColorArray("_TargetColors", new_colors.GetColors());
}

On the shader i have loop to operate the array where i compare the color of the current pixel, with the color of the i element of the first array and if it is similar i change that color to the i element of the second array

float4 _OriginalColors[55];
float4 _TargetColors[55];
float _Tolerance;
 ...

half4 col = tex2D(_MainTex, i.uv);

for(int index = 0; index < 4; index++)
{
    if (length(col - _OriginalColors[index]) < _Tolerance)
    {
        return half4(_TargetColors[index].rgb, col.a); 
    }
}

The problem is that for some reason it seems like the colors are changed when passing to the shaders, i’d tried printing them from the script with GetColorArray, and they dont look changed but when they are rendered on my sprite and i use the tool to select color, is not the same rgb code.

Example: i want to replace the color “1D0000”(this color would go on the first array) with the color “33005B”(this would go in the second array), but the color rendered is “7B00A0”, which seems to be “33005B” but modified.

Any idea why this may be happening?