Skip to content
/ imjson Public

A C++ library for defining Dear ImGui themes using JSON objects

License

Notifications You must be signed in to change notification settings

moleium/imjson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

imjson

imjson is a small C++ utility that allows theme definition for Dear ImGui through JSON files.

Features

  • Define ImGui style colors and variables using JSON objects.
  • Load themes from files, strings, or JSON objects.
  • Load fonts from JSON objects.

Example

This repository includes a single example file under example/ directory. To build an example, you will need to have CMake and a C++ compiler installed on your system, then use the provided CMakelists.txt.

Usage

To use imjson, include the imjson.h and imjson.cpp alongside nlohmann's JSON library header inside /dependencies in your project :D!

Here's an example of how to load a theme:

#include "imjson.h"

int main() {
    imjson::load_theme_from_file("my_theme.json");

    // or from a string
    imjson::load_theme_from_string(R"(
    {
        "Colors": {
	    "Text": [1.0, 0.0, 0.0, 1.0]
	}
    }
    )");
}

License

imjson is distributed under the MIT License.

About

A C++ library for defining Dear ImGui themes using JSON objects

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages