style.backgroundColor not setting if color comes form a struct ?

im doing this:

slot.Q("slot").style.backgroundColor = new StyleColor( colorPalette[i] );

where “colorPalette” is a Color[ ]

if i do that it doesn’t work, no color is set… if i add “+ Color.black” it works…

slot.Q("slot").style.backgroundColor = new StyleColor( colorPalette[i] + Color.black );

any idea why?

Could the alpha of the palette color be 0 (zero)? If that’s not it, I’d recommend reporting a bug (inside Unity, Help > Report a Bug) because it’d need to be investigated!

1 Like

OMG… it was that, my palette had all set to alpha 0. Thanks!!

1 Like