Author Topic: Color tint of label vs encoded color with tint override do not match  (Read 1802 times)

DirtyHippy

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
I am having trouble getting the same color to match when tinted directly via the label color vs encoded as a color in a label.  I've had this problem for a few years now with one of my controls, and I have kind of ignored it.  Now I want to fix it.  I am aware of the color tint override/color encoding available when encoding colors in label text, and I have read all the forum posts on similar topics.

As a simple test case, I drop two labels in the scene, using NGui fonts, with no effect/gradients specified (basically a pure, basic label).  I color one using the tint, and the other with a white tint but encoded with the same color as the first label (using the color tint override shouldn't matter i assume in this case, but I tried both anway).

The colors do not match.  The color on the encoded text label is brighter.  Now, I could probably find an encoded color that matches the tint version and simply map them depending on the method of color I am using, or I could consolidate my logic to always use encoded colors, but honestly that is a bit of a nightmare.

I have tested this in a new project with just ngui imported, and using one of the ngui fonts, I can get the color to match sometimes.  Sometimes, they will not match, and then i will switch fonts around, or something, and then they will match (for the same font combination)!  It is almost like the font colors are not being updated immediately in some cases until something triggers it.

This is driving me a bit nuts :-).  I am using linear lighting / NGui 3.9.4.  I am about to upgrade to the newest just to make sure that doesn't fix anything.

DirtyHippy

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: Color tint of label vs encoded color with tint override do not match
« Reply #1 on: March 24, 2016, 02:15:04 PM »
Super awesome.  Updating to the newest version fixed this issue!  I am assuming the color change or the linear space work was the fix.  Whatever the reason, I am really happy this is finally resolved.  And it required no code changes on my side.  My favorite kind of bug fix!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Color tint of label vs encoded color with tint override do not match
« Reply #2 on: March 27, 2016, 02:51:36 AM »
:)

Ran into this myself a few weeks ago (my new project is also using linear lighting). Naturally had to fix!