Author Topic: How to use palette and color?  (Read 1033 times)

Offline Alpha Centauri Bear

  • Colonel
  • ****
  • Posts: 466
    • View Profile
How to use palette and color?
« on: January 03, 2024, 01:49:18 pm »
I am building geoscape popup and trying to do this.
All text is one white.
List rows may be one of two other colors (not white) on condition.
What is the correct way to do it? Thank you.



Some generic questions.

Not all interfaces have palette set. Which palette will be used?

What is "id: palette" element? Is it same as palette or something different?

What palette is used by UFOInfo interface?
« Last Edit: January 03, 2024, 01:51:42 pm by Alpha Centauri Bear »

Offline Alpha Centauri Bear

  • Colonel
  • ****
  • Posts: 466
    • View Profile
Re: How to use palette and color?
« Reply #1 on: January 03, 2024, 02:28:10 pm »
One example of my confusion.
The UFO detection popup. Apparently it uses two colors in the list but I cannot find any color setting code in the UfoDetectedState::UfoDetectedState.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9095
    • View Profile
Re: How to use palette and color?
« Reply #2 on: January 03, 2024, 05:34:54 pm »
Not all interfaces have palette set. Which palette will be used?

Depends on the interface (and the source code).
Usually PAL_GEOSCAPE.

What is "id: palette" element?

It's an element for the background palette configuration.

Is it same as palette or something different?

Different.

What palette is used by UFOInfo interface?

PAL_GEOSCAPE

One example of my confusion.
The UFO detection popup. Apparently it uses two colors in the list but I cannot find any color setting code in the UfoDetectedState::UfoDetectedState.

Loading colors:

   add(_lstInfo, "text", "UFOInfo");

Changing colors:

   ss << Unicode::TOK_COLOR_FLIP << tr(heading);

Offline Alpha Centauri Bear

  • Colonel
  • ****
  • Posts: 466
    • View Profile
Re: How to use palette and color?
« Reply #3 on: January 03, 2024, 06:26:00 pm »
Thank you. Much clearer now.

One question about dots. Does OXCE always use primary color or it matches the color of the text in the cell?

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9095
    • View Profile
Re: How to use palette and color?
« Reply #4 on: January 03, 2024, 07:54:01 pm »
Don't know.
It does the same as OXC.