#Interesting coloring bug

1 messages · Page 1 of 1 (latest)

hot cairn
#

When creating a lot of objects and trying to give them all a different color after instantiating, unity doesnt really know what to do, it just renders them white.
Using the built in 2d render pipeline. After updating some color values on runtime on a objec the color correcst itself (for example sliding the alpha value).
Trying to pare roud map data from an geoJson file, I wanted to color each dot in the same color which are getting made in the same loop.

#

Interesting coloring bug

limpid briar
#

Color32 would be an int between 0 and 255

hot cairn
#

did not think that was it because in the inspector the "correct" color was shown but that was the problem

#

fixed it with diving by the maximum

#

now I'm getting this

limpid briar
#

Unless you specifically want it to have reduced color depth

hot cairn
#

was just a quick fix because I didnt wanted to google xD

limpid briar
hot cairn
#

did not for me

#

was all black

limpid briar
#

You also have to remove the division then

hot cairn
#

the division came afterwards

limpid briar
#

1f

hot cairn
#

like this right

#

wait

#

ok that works

#

oh... before this showed ints as input

#

that confused me

limpid briar
#

The documentation page for Random.Range directly has an example for float use, faster than both googling or guessing

#

It does both floats and ints depending on the variable type

hot cairn
#

well you get to the documentation page through googeling right?

hot cairn
limpid briar
hot cairn
#

👍