Class NvgColorUtil
java.lang.Object
com.spinyowl.legui.system.renderer.nvg.util.NvgColorUtil
NanoVG utility. Used to convert some NanoVG elements to other. For example
NVGColor to
Vector4f and back.-
Method Summary
Modifier and TypeMethodDescriptionstatic org.lwjgl.nanovg.NVGColorcreate(float r, float g, float b, float a) Used to allocate and fill instance ofNVGColor.static org.lwjgl.nanovg.NVGColorcreate(org.joml.Vector4fc rgba) Used to allocate and fill instance ofNVGColor.static voidfillNvgColorWithRGBA(float r, float g, float b, float a, org.lwjgl.nanovg.NVGColor color) Used to fillNVGColor.static voidfillNvgColorWithRGBA(org.joml.Vector4fc rgba, org.lwjgl.nanovg.NVGColor color) Used to fillNVGColor.
-
Method Details
-
fillNvgColorWithRGBA
public static void fillNvgColorWithRGBA(float r, float g, float b, float a, org.lwjgl.nanovg.NVGColor color) Used to fillNVGColor.- Parameters:
r- red.g- green.b- blue.a- alpha.color- color to fill.
-
fillNvgColorWithRGBA
public static void fillNvgColorWithRGBA(org.joml.Vector4fc rgba, org.lwjgl.nanovg.NVGColor color) Used to fillNVGColor.- Parameters:
rgba- rgba colorVector4fcof floats.- rgba.x - red.
- rgba.y - green.
- rgba.z - blue.
- rgba.w - alpha.
color- color to fill.
-
create
public static org.lwjgl.nanovg.NVGColor create(float r, float g, float b, float a) Used to allocate and fill instance ofNVGColor. Should be used in try-with-resources to avoid memory leaks.- Parameters:
r- red.g- green.b- blue.a- alpha.- Returns:
- allocated and filled color.
-
create
public static org.lwjgl.nanovg.NVGColor create(org.joml.Vector4fc rgba) Used to allocate and fill instance ofNVGColor. Should be used in try-with-resources to avoid memory leaks.- Parameters:
rgba- rgba colorVector4fcof floats.- rgba.x - red.
- rgba.y - green.
- rgba.z - blue.
- rgba.w - alpha.
- Returns:
- allocated and filled color.
-