Skip to content

Instantly share code, notes, and snippets.

@bani
Created February 16, 2016 01:23
Show Gist options
  • Save bani/0a640fa3fd4964416a55 to your computer and use it in GitHub Desktop.
Save bani/0a640fa3fd4964416a55 to your computer and use it in GitHub Desktop.

Revisions

  1. bani created this gist Feb 16, 2016.
    16 changes: 16 additions & 0 deletions pebble_set_background.c
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    static void set_background_gem(int color) {
    APP_LOG(APP_LOG_LEVEL_DEBUG, "Updating background gem");
    if (s_bitmap) gbitmap_destroy(s_bitmap);
    switch(color) {
    case 0:
    s_bitmap = gbitmap_create_with_resource(RESOURCE_ID_DIAMOND);
    break;
    case 1:
    s_bitmap = gbitmap_create_with_resource(RESOURCE_ID_DIAMONDAQUA);
    break;
    // (...)
    default:
    s_bitmap = gbitmap_create_with_resource(RESOURCE_ID_DIAMOND);
    }
    bitmap_layer_set_bitmap(s_bitmap_layer, s_bitmap);
    }