How can I find the current background/foreground color?

It seems strange that there is not a specific get function to determine the current background color of a device.  How can this be accomplished when creating a widget and widget glance.  Specifically I have multiple devices with different glance backgrounds.  If I want to stay consistent with the overall look and feel I need to know what current is.  I'm not talking about night mode, I'm asking about simple standard displays.  Fenix 6 glances are black background with white lettering not to mention title in caps, Edge 1050 is white background with black lettering in lower case.  This really seems fundamental to me!  I am not able to find where I could find the current background color or for that matter even the device the widget is running on. Thanks for your help in advance.

  • Maybe System.DeviceSettings.PartNumber can help you?

    The architecture also enables you to create specific code for each supported device.

  • Yeah I looked at that.  I was thinking I could at least determine the standard background color based on part number.  The problem is there is no distinction of device type based on part number.  There are no qualifying patterns.  So other than having a table of part numbers that I check against, which may or may not be accurate since I only have a few devices, it does not work.  I'm really at a loss here since I have just started working on developing in this platform and the gaps in capability in determining what you would think are the most fundamental capabilities just don't existing.  Not to mention the developer forum from a search perspective is one of the worst I have ever encountered.  It appears I can't even determine the device I am running on, other than by part number and a large table which of course is not possible given the storage constraints, but maybe this is possible and I just am not aware.  

  • I asked somewhat similar questions in the past in the forum. I have not received any useful information. Of course except for datafields, where you have getBackgroundColor().

    I used 2 tactics for the launcher widget (because you see it in the glance). Either I used a "middle gray" color with transparent background or I include a background (a rounded rectangle). So for example either I decide to have a white background and the actual drawing is black, or the other way around (example: https://apps.garmin.com/apps/33cbe5de-5b7c-4d11-9763-063be517e11c ). Or you can try something like this: https://apps.garmin.com/apps/3430778e-6fee-4eb6-b799-21d9d59a41eb where it looks great on white background but it's also OK on black, because there's a black outline. 

  • I know this question is about widgets and glances, but for completeness I will point out that the background of the activity/app list isn't necessarily constant for a given device.

    For example, Forerunner 935's app/activity list uses a white background for the favorites at the top, but a black background for everything else.

    And I think that super old Fenix watches (Fenix 3?) had a "system theme" option which allowed you to choose between black and white backgrounds for most things (I think this applied to system menus, and possibly the top-level view of widgets?)

    So not only is information about background colour not available as a comprehensive list for all devices, it isn't necessarily even constant for some devices.

    I agree it's too bad that this information isn't available at runtime in general.

    What you can probably bet on is that any AMOLED device will have a black background for most or all screens, to conserve battery life and avoid burn-in. For example, MIP devices allow you to select a black or white background for native watchfaces and activity data pages, while AMOLED devices lack the white background option.