[Pictures Included] Change colour of a blurred Object Issue?

Hi, I created an image using Photoshop Gaussian blur. I am trying to change the colour of it using a script. But whenever I do that, the picture becomes kind of pixelated [Image Included]. The code I am using to change the colour is -

`Color primaryColor = new Color[1];
Color secondaryColor = new Color[1];

primaryColor[0] = new Color(255f,0f,0f,255f);
secondaryColor[0] = new Color(255f,255f,255f,255f);

topRender.material.color = primaryColor[Random.Range(0, 1)];
bottomRender.material.color = secondaryColor[Random.Range(0, 1)];`

Note: When I manually change the colour from the Renderer in Unity, this does not happen.

These are just the snaps of the code. I am putting them in an array because I am trying to randomize the colour of the object.

Hi @dabomb_labs

Check the manual: Unity - Scripting API: Color

There it says, that colors go from 0-1. So red 255 is 1, not 255 and so on.

There is also Color32 but you are not using it.

To me it seems like that as you have alpha value, setting color to 255 will just push the pixel values near transparent towards opaque.

So instead of:

var col = new Color(255f,0f,0f,255f); 

123643-20180830-halo1.png

Do this:

Color col = new Color(1f,0,1f);

123644-20180830-halo2.png