X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=vg_imgui.h;h=0a83a53f714e6fe6e59bac27fe03eedfa2582e7d;hb=543f7ce8b73edfddea525406a87e416afe366bb3;hp=4433b2a2d9b650d7cdd576618297d7bd0baa37f5;hpb=0c0c6400342e733cdb1147dba7d27287f888731f;p=vg.git diff --git a/vg_imgui.h b/vg_imgui.h index 4433b2a..0a83a53 100644 --- a/vg_imgui.h +++ b/vg_imgui.h @@ -850,6 +850,11 @@ static void ui_text_glyph( const struct ui_font *font, ui_px scale, out_texcoords[3] = out_texcoords[1] + font->glyph_height; } +static u32 ui_opacity( u32 colour, f32 opacity ){ + u32 alpha = opacity * 255.0f; + return (colour & 0x00ffffff) | (alpha << 24); +} + static u32 ui_ntext( ui_rect rect, const char *str, u32 len, ui_px scale, enum ui_align align, u32 colour ){ ui_rect text_cursor;