What color palette support a device?

Dear all
Is there an connect iq API to get what color palette the device support? (16, 64 or 65536 color)
Or
Is there an connect iq API to get if a color is supported on a device? For example Fenix 3 support 0x00AA00 but not 0x005500

Thank in advance

best regards

Marco
  • Thanks, i know these documents. But it means that it should exit an API to get the device model or the device color palette supported (16, 64 or 65536 color)
    My primary question is: How can I write a code to decide what color apply depending on the colors supported?

    For example:

    var color;
    if (getNColorsSupported() == 16) {
    color = 0x00AA00 ;
    }
    else {
    color = 0x005500 ;
    }

    function getNColorsSupported() {
    // code to get the number of colors the device support
    ????????????
    return NColorsSupported ;
    }

    Thanks in advance for your feedback
  • Former Member
    Former Member over 7 years ago
    May I ask what you are wanting to do that requires being able to check at runtime for a specific color that might not be available on a device?

    If you want to implement this yourself, you could easily set up a couple of functions with the values hardcoded and just implement some build exclusions for each device to point to the right hardcoded value. See here for implementation in that regard: https://developer.garmin.com/connect...ing-resources/
  • Like asandweech said, maybe if you explained what you wanted to do, we could find a solutions that works Are you just looking at how to set colors for various data on the screen for example? There, the answer could be app settings..
  • Thank you for your suggestions
    I try to explain you. I'm going to develop a watchface for a lot of devices. The users will set the background color by the app setting, The color should be the darkest possible.
    The "darkest" is depending of the number of colors of the device color palette. For example, the darkest green of the 16 color device palette is 0x00AA00 while the darkest green of the 64 color device palette is 0x005500,
    I'd like to avoid to manage a lot of xml resource files depending on the device model.

    Thanks in advance

  • Former Member
    Former Member over 7 years ago
    I'd like to avoid to manage a lot of xml resource files depending on the device model.

    Your setup, if I am understanding things correctly, could implement build exclusions without the need for any resource files. Define your function or value getNColorsSupported three times, one for each device palette, and prepend each definition with an annotation. Then using jungles you would set the excludeAnnotations property for each device to exclude the annotations for the other two device palettes.
  • I have implemented the build exclusions solution
    It works fine. :)

    thanks a lot