Skip to content

Instantly share code, notes, and snippets.

local Severe = {};
Severe.NotificationType = {
Error = "error",
Info = "info",
};
Severe.Notify = SendNotification;
Severe.GetHWID = gethwid;
Severe.SetClipboard = setclipboard;
@tumen102
tumen102 / ColourUtil.java
Last active June 20, 2021 09:09
Set openGL colour with a integer instead of floats/doubles.
public static float[] hexToFloat(int colourToConvert) {
float red = (float) (colourToConvert >> 16 & 255) / 255.0F;
float green = (float) (colourToConvert >> 8 & 255) / 255.0F;
float blue = (float) (colourToConvert & 255) / 255.0F;
return new float[] {red, green, blue};
}
public static void glColorInt(int hexColour) {
float[] rgbValues = hexToFloat(hexColour);
GL11.glColor3f(rgbValues[0], rgbValues[1], rgbValues[2]);