added alpha component to Color

This commit is contained in:
bdew committed 2014-02-24 20:52:38 +02:00
1 parent 82e88157f2
commit 4e2df02b8a
1 file changed
+3 -2
+3 -2
View File
@@ -11,10 +11,11 @@ package net.bdew.lib.gui
import org.lwjgl.opengl.GL11
case class Color(r: Float, g: Float, b: Float) {
case class Color(r: Float, g: Float, b: Float, a: Float = 1) {
def this(c: (Float, Float, Float)) = this(c._1, c._2, c._3)
def this(c: (Float, Float, Float, Float)) = this(c._1, c._2, c._3, c._4)
def activate() {
GL11.glColor3f(r, g, b)
GL11.glColor4f(r, g, b, a)
}
}