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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Question Select button color only works with white background

Discussion in 'Editor & General Support' started by vandel212, Jun 17, 2020.

  1. vandel212

    vandel212

    Joined:
    May 10, 2020
    Posts:
    24
    Hi, I'm having difficulty changing by button's color on selecting it. I want to have the button's Image color be black with a transparency. When I click the button, nothing happens. If I set he button's image color to white with a transparency, it works just fine on clicking. I want the default style to be a dark transparent color, not white, but I need the selected color functionality as well.
     
  2. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,923
    What button, where, how you do it?
     
  3. vandel212

    vandel212

    Joined:
    May 10, 2020
    Posts:
    24
    A button. A regular old button. There is nothing else to say about the set up. You can replicate it by creating a new project adding a canvas and button to the scene, setting it's selected color to red and its image color to black, then running, and clicking the button. It doesn't change color. If you change the image color to white, run, then click it, the button color will be red.

    I want to be able to change the color regardless of the button's image color.
     
  4. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,923
    Try the normal color? Image color is for image tinting I think.
    Like this:
    answwer2.png

    No selection:
    answwer.png

    Selection:
    answwer1.png

    And BTW, yes, there are many thing. There is button in the old IMGUI library, there is this button in the Unity UI, there is the TextMeshPro button, and then there is the UI Toolkit button and finally the UI Toolkit runtime button. So "regular old button" doesn't cut it when you don't specify what you're doing and with what button. Especially not in the Editor support forum, because you know... editor UI and stuff.
     
    Last edited: Jun 17, 2020
  5. vandel212

    vandel212

    Joined:
    May 10, 2020
    Posts:
    24
    Got it. Either way, that fixed it. Thanks.
     
    Lurking-Ninja likes this.