color.r is not behaving properly.

Hi, I have a script that just changes the rbg values of a color.

It’ really basic.

var color : Color;

function Awake (){
color.r = 120;

The value of red is times by 120???

If I put

color.r = 1;

The value is 255.

What’s happening? It used to work…

Cheers, Tim

Happens with all color values.(r b g)

When you access colors via script, it’s a float from 0 to 1. So, if you want R 120, write color.r=120/255;

1 values are from 0.0 to 1.0