Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Pebble watchface background image example code
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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment