MurphyMc/lux

Colorspace issues

MurphyMc opened this issue · 0 comments

There are a couple places where colors may end up wrong depending on the color ordering of your system:

  • Text drawing
  • The angled window notches (e.g., around the resize handles)

I'm not positive about the following, but here are some thoughts off the top of my head:

The former I think is just because the color passed to the text rendering function should be an "un-normalized" color, but it's passed a normalized color. This should be pretty easy to fix.

The latter is more tricky and has to do with the fact that the notches are drawn into a scratch buffer which is then blitted to the screen. If the scratch buffer could be created to match the screen, this would be easy, but it seems things are more complicated than this. The scratch buffer needs to be 32 bit, but it seems that sometimes the screen isn't. Moreover, the RGB/BGR ordering for the mode that the screen gets (which may be, e.g., 16 bit) seems to not necessarily match the ordering for 32 bit on the same machine. So while we currently cache colors translated for the screen, those aren't necessarily right for the scratch buffer.

The current code "works right for me", so it's a bit tricky to fully figure out what's going on on other machines. Revisiting it on another machine/OS or just carefully going through the exact color transformations that we should perform for each case would be helpful.