diff --git a/src/modules/theme/theme.c b/src/modules/theme/theme.c index 268d7bf50..08b345fe7 100644 --- a/src/modules/theme/theme.c +++ b/src/modules/theme/theme.c @@ -67,3 +67,17 @@ void ffParseThemeJsonObject(FFThemeOptions* options, yyjson_val* module) ffPrintError(FF_THEME_MODULE_NAME, 0, &options->moduleArgs, "Unknown JSON key %s", key); } } + +void ffGenerateThemeJson(FF_MAYBE_UNUSED FFThemeOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module) +{ + FF_STRBUF_AUTO_DESTROY theme = ffStrbufCreate(); + const char* error = ffDetectTheme(&theme); + + if(error) + { + yyjson_mut_obj_add_str(doc, module, "error", error); + return; + } + + yyjson_mut_obj_add_strbuf(doc, module, "result", &theme); +}