1 #include <cppurses/painter/color.hpp> 2 3 #include <string> 4 5 namespace cppurses { 6 color_to_string(Color c)7std::string color_to_string(Color c) { 8 std::string name{"Error"}; 9 switch (c) { 10 case Color::Black: 11 name = "Black"; 12 break; 13 case Color::Dark_red: 14 name = "Dark Red"; 15 break; 16 case Color::Dark_blue: 17 name = "Dark Blue"; 18 break; 19 case Color::Dark_gray: 20 name = "Dark Gray"; 21 break; 22 case Color::Brown: 23 name = "Brown"; 24 break; 25 case Color::Green: 26 name = "Green"; 27 break; 28 case Color::Red: 29 name = "Red"; 30 break; 31 case Color::Gray: 32 name = "Gray"; 33 break; 34 case Color::Blue: 35 name = "Blue"; 36 break; 37 case Color::Orange: 38 name = "Orange"; 39 break; 40 case Color::Light_gray: 41 name = "Light Gray"; 42 break; 43 case Color::Light_green: 44 name = "Light Green"; 45 break; 46 case Color::Violet: 47 name = "Violet"; 48 break; 49 case Color::Light_blue: 50 name = "Light Blue"; 51 break; 52 case Color::Yellow: 53 name = "Yellow"; 54 break; 55 case Color::White: 56 name = "White"; 57 break; 58 } 59 return name; 60 } 61 62 } // namespace cppurses 63