/** * <div class="header"> * High-level OpenGL Wrapper/Helpers: Utility Templates * Authors: S.Percentage * </div> */ /** Macros: COPYRIGHT = Copyright 2016 S.Percentage DDOC = <!DOCTYPE html> <html><head> <meta charset="utf-8"> <title>$(TITLE)</title> <link rel="stylesheet" href="style.css" type="text/css" /> </head><body> <div class="box"> <h1>$(TITLE)</h1> $(BODY) <hr>$(SMALL Page generated by $(LINK2 https://dlang.org/ddoc.html, Ddoc). $(COPYRIGHT)) </div> </body></html> */ module objectivegl.utils; import std.meta; /// Hex to RGBA for glClearColor/glColor4f(0xaarrggbb) template HexColor(uint hex) { immutable Alpha = ((hex >> 24) & 0xff) / 255.0f; immutable Red = ((hex >> 16) & 0xff) / 255.0f; immutable Green = ((hex >> 8) & 0xff) / 255.0f; immutable Blue = (hex & 0xff) / 255.0f; alias HexColor = AliasSeq!(Red, Green, Blue, Alpha); }