Background color of EDGE 1050

What color is the background black color of edge1050?

One user said to me, it's annoying thing...

I checked using if(background color == Graphics.COLOR_BLACK)

Please, let me know color code of the EDGE 1050 background.

added 2024. 08. 29. 21:36

One user tested background color 0x17181D instead of COLOR_BLACK.

The result is as follows,

Finally, he satisfied.

  • Are you sure it's not due to the backlight that it doesn't look completely black?

    You can use

    getBackgroundColor();
    for the data field

    getBackgroundColor() as Graphics.ColorType

    Get the current Data Field background color.

    Some devices provide a global Data Field background color setting. This method will return the current value of that setting as a value of either Graphics.COLOR_WHITE or Graphics.COLOR_BLACK.

    Returns:

  • Are you sure it's not due to the backlight that it doesn't look completely black?

    idk it seems 100% obvious from the screenshot that the 2 fields on the lower right are CIQ fields and their background is black, while the other fields seem to be native fields and their background is grey.

    Not sure how the backlight could account for that - just look at the picture and ask yourself if the difference between the grey and black areas looks like a natural result of a non-uniform backlight. Hint: with a non-uniform backlight, the shapes of adjacent areas with different brightnesses typically aren’t rectangular, and the brightness doesn’t change suddenly like that.

    Also, wouldn’t it be an amazing coincidence that the brighter part of the backlight just happens to coincide with the native fields, while the darker part of the backlight just happens to coincide with the CIQ fields?

    OP could “prove” this conclusively by taking a picture with the same layout where the top and bottom fields are CIQ fields, and the rest are native, but I believe them. 

    You can use

    getBackgroundColor();
    This method will return the current value of that setting as a value of either Graphics.COLOR_WHITE or Graphics.COLOR_BLACK.

    Clearly OP wants to know the real background color of a “black” activity page, so they can match it in their data field. Given that getBackgroundColor() only returns white or black, it doesn’t seem that this will be helpful for that purpose.

    Besides OP already wrote:

    I checked using if(background color == Graphics.COLOR_BLACK)

  • Looks like you’re using a background color of Graphics.COLOR_BLACK for your data field, which doesn’t seem to match the actual background color of the native data screen.

    Have you tried COLOR_TRANSPARENT? Hopefully this would work for either a white or “black” native background, and you wouldn’t have to worry about matching the real color that’s used by the native data screen.

    That way, you would only need getBackgroundColor() to determine the color of the foreground.

    e.g.

    var foregroundColor = (getBackgroundColor() == Graphics.COLOR_BLACK) ?
        Graphics.COLOR_WHITE : Graphics.COLOR_BLACK;
    dc.setColor(foregroundColor, Graphics.COLOR_TRANSPARENT);

  • 1. If the native background color is almost but not exactly black like in the picture, then this will give you black foreground.

    2. if you clear the screen with transparent color, then it might not clear "garbage" it is supposed to clear IMHO.

  • 1. If the native background color is almost but not exactly black like in the picture, then this will give you black foreground.

    No bc according to both the doc and the op (implied *), getBackgroundColor() returns COLOR_WHITE or COLOR_BLACK (regardless of what the real color is). If getBackgroundColor() returned the “real” background color, then OP’s problem wouldn’t occur.

    (Also, note that the docs refer to a background color *setting* of white or black, not the literal background color.)

    I checked using if(background color == Graphics.COLOR_BLACK)

    (* they don’t say where “background color” is coming from, but I can’t imagine where else it could be from other than getBackgroundColor()).

    I would also argue that it would be terrible implementation for the SDK to start returning anything other than COLOR_WHITE and COLOR_BLACK, because that would break a ton of existing code. And it would make it hard to know what color to use for the foreground (as you pointed out).

    If Garmin wanted to return the “real” background color (e.g. some shade of grey), then it would be best to provide a new API function for this.

    2. if you clear the screen with transparent color, then it might not clear "garbage" it is supposed to clear IMHO.

    In this case, when you say “IMHO”, do you rly mean “afaik“?

    It’s not a matter of opinion (humble or not) whether clearing the screen with the transparent color won’t work, it’s either true or false (for any given device / firmware). Being unsure about a fact doesn’t turn it into an opinion. Like if I’m not sure if it’s raining, it wouldn’t make sense for me to say “it’s not raining imho”.

    But yeah, that seems like it would be a problem for my approach.

    Ig OP could take a screenshot on the device and determine the real background color in an image program (assuming it really isn’t black).

    But obviously that only works for devices they have access to and which support screenshots (via hot key).

  • Here is the code I used,
    var txtColor;
    var bgColor = getBackgroundColor();
    var bgIsBlack = bgColor == Graphics.COLOR_BLACK;
    
    if (bgIsBlack) {
     txtColor = Graphics.COLOR_WHITE;
    } else {
     txtColor = Graphics.COLOR_BLACK;
    }
    
    dc.setColor(txtColor, bgColor);
    dc.clear();
    
    dc.setColor(txtColor, -1);
    If I changed background color to transparent color, result is as follows,
  • If I changed background color to transparent color, result is as follows,

    Yeah, was right, a transparent background color won't work because you need to be able to clear the DC :/.

    Sorry, bad advice.

    I think you might have to ask the user to get a screenshot (not picture) of their data screen (with both native and Connect IQ fields), so you can see what the actual "black" background color is on their device using an image editor.

    That way you can match the color, at least for that model.

  • My friend has agreed to lend me that device, so I need to get it and try it out.

    Thank you.

  • Another thing you can try is to look into the simulator.json and maybe the compiler.json to see if the background color is there.