MCPcopy Create free account
hub / github.com/YACReader/yacreader / colorFromJson

Function colorFromJson

YACReaderLibrary/themes/theme_factory.cpp:948–954  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

946// JSON helpers ---------------------------------------------------------------
947
948static QColor colorFromJson(const QJsonObject &obj, const QString &key, const QColor &fallback)
949{
950 if (!obj.contains(key))
951 return fallback;
952 QColor c(obj[key].toString());
953 return c.isValid() ? c : fallback;
954}
955
956Theme makeTheme(const QJsonObject &json)
957{

Callers 1

makeThemeFunction · 0.70

Calls 3

toStringMethod · 0.80
containsMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected