33 using std::chrono::milliseconds;
41 template<
typename _type>
56 return std::stoi(FetchSetting<string>(con, name));
63 const auto s(FetchSetting<string>(con, name).c_str());
66 if(std::sscanf(s,
"%u%u%u", &r, &g, &b) != 3)
67 throw std::invalid_argument(
"Color components are not enough.");
69 if(r < 0x100 && g < 0x100 && b < 0x100)
70 return Color(r, g, b);
71 throw std::invalid_argument(
"Invalid color components found.");
73 return Color(min<Color::MonoType>(r, 0xFF), min<Color::MonoType>(g, 0xFF),
74 min<Color::MonoType>(b, 0xFF));
80 ColorToNode(
const string& name,
const Color& value)
94 FetchSetting<string>(con, family)))
95 return Font(*p, FetchSetting<int>(con, size));
102 : UpColor(240, 216, 192), DownColor(192, 216, 240), FontColor(),
104 ScrollDuration(1000), SmoothScrollDuration(80)
107 : UpColor(FetchSetting<
Color>(con,
"UpColor")), DownColor(
108 FetchSetting<
Color>(con,
"DownColor")), FontColor(FetchSetting<
Color>(con,
109 "FontColor")), Font(FetchFontSetting(con,
"FontFamily",
"FontSize")),
110 SmoothScroll(FetchSetting<int>(con,
"SmoothScroll") != 0),
111 ScrollDuration(FetchSetting<int>(con,
"ScrollDuration")),
112 SmoothScrollDuration(FetchSetting<int>(con,
"SmoothScrollDuration"))
118 ColorToNode(
"DownColor", DownColor),
119 ColorToNode(
"FontColor", FontColor),
120 MakeNode(
"FontFamily", Font.GetFontFamily().GetFamilyName()),
124 StringifyToNode(
"SmoothScrollDuration", SmoothScrollDuration.count())};