Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity UI Tint the UI

Discussion in 'UGUI & TextMesh Pro' started by rgonsalv, Jun 29, 2018.

  1. rgonsalv

    rgonsalv

    Joined:
    Sep 29, 2016
    Posts:
    47
    In the UI system is there a way to provide a global tint? An example would be reducing the blue component of all UI objects at night.

    We tried setting the color on all the CanvasRenderers of our objects, but notice the color reverting when we mouse over them. Also it's probably too slow if there are lots of objects.

    CanvasGroup has an alpha control, but no color setting unfortunately.
     
  2. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    1,096
    I guess you need a post processing shader for the ui.
     
  3. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    823
    Instead of changing every tint color for every ui element, I would suggest changing the Default UI Shader (You can find the unity shaders in Built in Shaders) to have a slot for another tint color (maybe also through a global Vector value if you want to have different materials for the UI. Then you can write a simple script that finds all Images and sets the Material slot to your new Shader Material. By changing the material or setting the global Shader value you could then easily control the tint of the ui or even create other effects that just desaturate colors as you suggested.
     
    Hosnkobf likes this.