Skip to content

ImKit 4.0 API

This page lists what 4.0 adds to the public API and where each piece lives. Every entry is a draw call: the host owns values, state and lifetime, and handles the returned request. Changed defaults and removed forwards are in the migration guide.

Header CMake target What it adds Gallery page
imkit/theme.h imkit::imkit MakeBrandTheme, BrandPalette, SetCornerStyle, PushTextRole, SerializeTheme, ParseTheme, outline strokes, hard shadows Theme Studio
imkit/skin.h imkit::imkit Skin: replace the frame of buttons, badges and cards Skins
imkit/charts.h imkit::imkit DonutChart, BarChart, Gauge, Sparkline, ChartColor Charts
imkit/ptz.h imkit::imkit PtzControl: pan, tilt, zoom and presets PTZ camera
imkit/range_slider.h imkit::imkit RangeSlider, RangeSliderInt Numbers and units
imkit/components.h imkit::imkit DrawShadow, IMKIT_DEPRECATED, AxisVector3Field, CompactIconActionButton Before / After, Workspace
imkit/workflow.h imkit::imkit BeginCollapsibleInspectorCard, EndCollapsibleInspectorCard, HierarchyRowView::accentColor Workspace
imkit/show.h imkit::show Controls, cue list, mixer, rules, schedule, beat, script, pictures, control surface, LED, address Show

MakeBrandTheme derives control states, selection, secondary text and a border from four colours and keeps text and border readable on every surface. Check the result with ValidateContrast; a low value is a warning and the theme is still usable.

#include <imkit/imkit.h>
imkit::BrandPalette brand;
brand.canvas = {0.063f, 0.067f, 0.075f, 1};
brand.surface = {0.102f, 0.106f, 0.118f, 1};
brand.text = {0.925f, 0.933f, 0.945f, 1};
brand.accent = {0.471f, 0.839f, 0.776f, 1};
auto theme = imkit::MakeBrandTheme(brand);
imkit::SetCornerStyle(theme, imkit::CornerStyle::Round);
theme.elevation.hard = true; // a solid, offset shadow
theme.elevation.offset = {0, 3};
imkit::ApplyTheme(theme, 1.0f); // before ImGui::NewFrame()

A theme is also plain text. SerializeTheme(theme) writes key = value lines, and ParseTheme(text, theme) applies them: unknown keys are skipped with a warning and never stop the rest. ImKit reads no files; the host loads them. The keys are listed in Look your own way.

A skin replaces only the frame and background of a component. Labels, icons, focus rings, accessibility, input and return values stay with ImKit. A skin reaches components that receive the theme (ComponentOptions::theme).

static bool DrawFrame(const imkit::SkinFrame& f, void* user) {
if (f.part != imkit::SkinPart::Button) return false; // keep the default
f.draw->AddRect(f.min, f.max, IM_COL32(120, 214, 198, 255), f.rounding, 0, 2.f);
return true;
}
imkit::Skin skin{&DrawFrame, nullptr};
theme.skin = &skin; // non-owning, like theme.fonts
Call Returns Notes
DonutChart(id, view, layout, options) clicked segment, or -1 Hover enlarges a segment and shows its value.
BarChart(id, view, layout, options) clicked bar, or -1 Vertical or horizontal, optional grid and value labels.
Gauge(id, view, layout, options) Zones colour the ring. A negative fraction renders as unavailable.
Sparkline(id, view, layout, options) Highlights the last point; hover shows a value.
PtzControl(id, view, state, layout, options) PtzRequest The host moves the camera; the control reports velocity and preset requests.
RangeSlider(label, &low, &high, min, max, ...) true on the frame it changes Two handles; drag the span to move both.
const std::array<imkit::ChartDatum, 3> usage{{{"Render", 44}, {"Cache", 25}, {"Decode", 15}}};
imkit::DonutChart("storage", {usage, "84 GB", "Used"});
static float low = 20, high = 80;
imkit::RangeSlider("Range", &low, &high, 0, 100, "%.0f");

imkit::show is optional and links as imkit::show. It covers performance controls (Fader, Knob, XYPad, PadGrid, MeterBar, HoldButton), live components (CueList, GoBar, ClipLauncher, Mixer, EffectRack), a no-code RuleBuilder, scheduling, beat tools, a script panel, picture buttons, a free-form ControlSurface, LED tools and DMX address tools. Continuous controls return a ValueEdit. Component by component, with ownership rules, see the Show guide.

ImKit does Your application keeps
Draws and returns requests (PtzRequest, GoBarRequest, chart clicks) The camera, the cue engine, the data behind a chart
Reads a Skin and a Theme for the call The lifetime of both, and the font atlas
Parses theme text you pass in Reading and writing theme files