Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

SpriteRenderer.color works with Colors.red but not New Color{x,x,x,x}.

Discussion in 'Scripting' started by smurftra, Apr 19, 2020.

  1. smurftra

    smurftra

    Joined:
    Jan 16, 2018
    Posts:
    9
    Exactly as the title said:

    If I use Unity's constant to set the color it applies properly
    If I use a UnityEngine.Color that I instanciate myself I don't see any change
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,971
    Without any code anywhere in sight, all I can say is,

    "It must be a bug."

    Perhaps you might post some code (see formatting guidelines in the first post in the forum) to give us a fighting chance of understanding what might be going wrong!
     
  3. smurftra

    smurftra

    Joined:
    Jan 16, 2018
    Posts:
    9
    You are correct. I was using rgb values 0,255. not 0,1.
     
  4. Leonetienne500

    Leonetienne500

    Joined:
    Dec 5, 2016
    Posts:
    130
    This is one of unitys bug-features. Why in all hell would they use normalized colors... 0-255 is the industry standard...

    At least they began cleaning their "half of the math functions use radians and the other half uses degrees and its on you to figure out which returns which format" mess