From 0191990eca2a30d29f3dd4878f017271bec32a63 Mon Sep 17 00:00:00 2001 From: Daniil Rozanov Date: Fri, 4 Apr 2025 14:50:18 +0400 Subject: wip --- include/ncurses/colors.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include/ncurses/colors.hpp') diff --git a/include/ncurses/colors.hpp b/include/ncurses/colors.hpp index a0622a9..e045ebb 100644 --- a/include/ncurses/colors.hpp +++ b/include/ncurses/colors.hpp @@ -8,6 +8,7 @@ namespace NCURSES_CPP_NAMESPACE { +// TODO: there is no usage for this for now enum class curs_color { black = COLOR_BLACK, red = COLOR_RED, @@ -25,17 +26,19 @@ struct rgb_color { unsigned char b; }; -NCURSES_CPP_CONSTEXPR static int +NCURSES_CPP_CONSTEXPR_INLINE static int rgb_to_curses(unsigned char c) NCURSES_CPP_NOEXCEPT { return static_cast(c) * 1000 / 255; } -NCURSES_CPP_CONSTEXPR static unsigned char +NCURSES_CPP_CONSTEXPR_INLINE static unsigned char curses_to_rgb(int c) NCURSES_CPP_NOEXCEPT { return static_cast((c * 255 / 1000) + (c * 255 % 1000 == 0 ? 0 : 1)); } +// TODO: start_color maybe needs to be defined somewhere else + inline bool has_colors() { return static_cast(::has_colors()); } inline bool can_change_color() { -- cgit v1.2.3