Class NvgColorUtil

java.lang.Object
com.spinyowl.legui.system.renderer.nvg.util.NvgColorUtil

public final class NvgColorUtil extends Object
NanoVG utility. Used to convert some NanoVG elements to other. For example NVGColor to Vector4f and back.
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.lwjgl.nanovg.NVGColor
    create(float r, float g, float b, float a)
    Used to allocate and fill instance of NVGColor.
    static org.lwjgl.nanovg.NVGColor
    create(org.joml.Vector4fc rgba)
    Used to allocate and fill instance of NVGColor.
    static void
    fillNvgColorWithRGBA(float r, float g, float b, float a, org.lwjgl.nanovg.NVGColor color)
    Used to fill NVGColor.
    static void
    fillNvgColorWithRGBA(org.joml.Vector4fc rgba, org.lwjgl.nanovg.NVGColor color)
    Used to fill NVGColor.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • fillNvgColorWithRGBA

      public static void fillNvgColorWithRGBA(float r, float g, float b, float a, org.lwjgl.nanovg.NVGColor color)
      Used to fill NVGColor.
      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 fill NVGColor.
      Parameters:
      rgba - rgba color Vector4fc of 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 of NVGColor. 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 of NVGColor. Should be used in try-with-resources to avoid memory leaks.
      Parameters:
      rgba - rgba color Vector4fc of floats.
      • rgba.x - red.
      • rgba.y - green.
      • rgba.z - blue.
      • rgba.w - alpha.
      Returns:
      allocated and filled color.