Configurable colors

This commit is contained in:
Neale Pickett 2015-11-11 19:17:13 -07:00
parent 9e801e6f1f
commit 61b5ba2176
3 changed files with 36 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{ {
"appKeys": { "appKeys": {
"bluetooth": 1, "bt": 1,
"color-bg": 2, "color-bg": 2,
"color-day": 4, "color-day": 4,
"color-hr": 9, "color-hr": 9,

View File

@ -232,11 +232,31 @@ static void bt_handler(bool connected) {
layer_mark_dirty(s_date_layer); layer_mark_dirty(s_date_layer);
} }
static GColor color_of_int(int color) {
#ifdef PBL_COLOR
return GColorFromHEX(color);
#else
if (color & 0x808080) {
return GColorWhite;
} else {
return GColorBlack;
}
#endif
}
static void in_received_handler(DictionaryIterator *rec, void *context) { static void in_received_handler(DictionaryIterator *rec, void *context) {
Tuple *sec_color_tuple = dict_find(rec, CONFIG_KEY_COLOR_SEC); Tuple *sec_color_tuple = dict_find(rec, KEY_COLOR_SEC);
if (sec_color_tuple) { if (sec_color_tuple) {
second_color = GColorFromHex(sec_color_tuple->value->int32); #ifdef PBL_COLOR
second_color = GColorFromHEX(sec_color_tuple->value->int32);
#else
if (sec_color_tuple->value->int32) {
second_color = GColorWhite;
} else {
second_color = GColorBlack;
}
#endif
} }
} }

View File

@ -1,6 +1,19 @@
#include <pebble.h> #include <pebble.h>
#pragma once #pragma once
typedef enum {
KEY_SECONDS = 0,
KEY_BT,
KEY_COLOR_BG,
KEY_COLOR_NUM,
KEY_COLOR_DAY,
KEY_COLOR_MON,
KEY_COLOR_TIC,
KEY_COLOR_SEC,
KEY_COLOR_MIN,
KEY_COLOR_HR
} MessageKey;
static const struct GPathInfo TIC_POINTS = { static const struct GPathInfo TIC_POINTS = {
4, (GPoint []){ 4, (GPoint []){
{-3, -100}, {-3, -100},