diff --git a/headers/os/interface/InterfaceDefs.h b/headers/os/interface/InterfaceDefs.h index 5a4edde3da..3792d1c4c9 100644 --- a/headers/os/interface/InterfaceDefs.h +++ b/headers/os/interface/InterfaceDefs.h @@ -351,6 +351,8 @@ enum color_which { }; _IMPEXP_BE rgb_color ui_color(color_which which); +_IMPEXP_BE void set_ui_color(const color_which &which, + const rgb_color &color); _IMPEXP_BE rgb_color tint_color(rgb_color color, float tint); extern "C" status_t _init_interface_kit_(); diff --git a/src/kits/interface/InterfaceDefs.cpp b/src/kits/interface/InterfaceDefs.cpp index b027832d02..af81bb6e57 100644 --- a/src/kits/interface/InterfaceDefs.cpp +++ b/src/kits/interface/InterfaceDefs.cpp @@ -737,6 +737,22 @@ ui_color(color_which which) } +_IMPEXP_BE void +set_ui_color(const color_which &which, const rgb_color &color) +{ + int32 index = color_which_to_index(which); + if (index < 0 || index >= kNumColors) { + fprintf(stderr, "set_ui_color(): unknown color_which %d\n", which); + return; + } + + if (be_app) { + server_read_only_memory* shared = BApplication::Private::ServerReadOnlyMemory(); + shared->colors[index] = color; + } +} + + _IMPEXP_BE rgb_color tint_color(rgb_color color, float tint) {