Index: Include/abgl.ab
===================================================================
--- Include/abgl.ab	(revision 80)
+++ Include/abgl.ab	(revision 88)
@@ -4,4 +4,22 @@
 #include <GL/gl.sbp>
 #include <GL/glu.sbp>
+
+Class PositionOnly
+	x As GLfloat
+	y As GLfloat
+	z As GLfloat
+Public
+End Class
+
+Class PositionColoered
+	x As GLfloat
+	y As GLfloat
+	z As GLfloat
+	r As GLfloat
+	g As GLfloat
+	b As GLfloat
+	a As GLfloat
+Public
+End Class
 
 Type XY_FLOAT
@@ -812,4 +830,95 @@
 	End Sub
 
+Public /* operator */
+	Sub operator = (ByRef c As Color4f)
+		This.R=c.R
+		This.G=c.G
+		This.B=c.B
+		This.A=c.A
+	End Sub
+
+Public /* method */
+	' HSBを求める式はhttp://ofo.jp/osakana/cgtips/hsb.phtmlを参考にした
+	' Drawwing\Color.abをさらに参考にしました。
+	Function GetHue() As GLfloat
+		Dim max As GLfloat, min As GLfloat, d As GLfloat
+		max = Math.Max(Math.Max(rgb.r, rgb.g), rgb.b)
+		min = Math.Min(Math.Min(rgb.r, rgb.g), rgb.b)
+		d = max - min
+		If rgb.g = max Then
+			Return ((rgb.b - rgb.r) As Double / d * 60.0 + 120.0) As GLfloat
+		ElseIf rgb.b = max Then
+			Return ((rgb.r - rgb.g) As Double / d * 60.0 + 240.0) As GLfloat
+		ElseIf rgb.g < rgb.b Then
+			Return ((rgb.g - rgb.b) As Double / d * 60.0 + 360.0) As GLfloat
+		Else
+			Return ((rgb.g - rgb.b) As Double / d * 60.0) As GLfloat
+		EndIf
+	End Function
+
+	Function GetSaturation() As GLfloat
+		Dim max As GLfloat, min As GLfloat
+		max = Math.Max(Math.Max(rgb.r, rgb.g), rgb.b)
+		min = Math.Min(Math.Min(rgb.r, rgb.g), rgb.b)
+		Return (max - min) / max
+	End Function
+
+	Function GetVolue() As GLfloat
+		Dim max As GLfloat
+		max = Math.Max(Math.Max(rgb.r, rgb.g), rgb.b)
+		Return max
+	End Function
+
+Public /* static method */
+	Static Function FromRGB(r As GLbyte, g As GLbyte, b As GLbyte) As Color4f
+		Dim ret As Color4f(r/255,g/255,b/255,1.0)
+		Return ret
+	End Function
+	Static Function FromCOLORREF(c As COLORREF) As Color4f
+		Dim ret As Color4f((c and &hff)/255,(c>>8 and &hff)/255,(c>>16 and &hff)/255,1.0)
+		Return ret
+	End Function
+	Static Function FromHSV(h As GLfloat, s As GLfloat, v As GLfloat, a As GLfloat) As Color4f
+		Dim r As GLfloat
+		Dim g As GLfloat
+		Dim b As GLfloat
+		Dim a As GLfloat
+		If h<0 Then h+=360.0
+		If h>360.0 Then h-=360.0
+		Select Case (h/60) As Long
+			Case 0
+				r=v
+				g=v*(1-s*(1-(h/60-(h/60) As Long)))
+				b=v*(1-s)
+			Case 1
+				r=v*(1-s*(h/60-(h/60) As Long))
+				g=v
+				b=v*(1-s)
+			Case 2
+				r=v*(1-s)
+				g=v
+				b=v*(1-s*(1-(h/60-(h/60) As Long)))
+			Case 3
+				r=v*(1-s)
+				g=v*(1-s*(h/60-(h/60) As Long))
+				b=v
+			Case 4
+				r=v*(1-s*(1-(h/60-(h/60) As Long)))
+				g=v*(1-s)
+				b=v
+			Case 5
+				r=v
+				g=v*(1-s)
+				b=v*(1-s*(h/60-(h/60) As Long))
+			Case 6
+				r=v
+				g=v*(1-s*(1-(h/60-(h/60) As Long)))
+				b=v*(1-s)
+		End Select
+
+		Dim ret As Color4f(r,g,b,a)
+		Return ret
+	End Function
+
 Public
 	rgba As RGBA_FLOAT
@@ -855,4 +964,95 @@
 		rgba.a = a
 	End Sub
+
+Public /* operator */
+	Sub operator = (ByRef c As Color4d)
+		This.R=c.R
+		This.G=c.G
+		This.B=c.B
+		This.A=c.A
+	End Sub
+
+Public /* method */
+	' HSBを求める式はhttp://ofo.jp/osakana/cgtips/hsb.phtmlを参考にした
+	' Drawwing\Color.abをさらに参考にしました。
+	Function GetHue() As GLfloat
+		Dim max As GLfloat, min As GLfloat, d As GLfloat
+		max = Math.Max(Math.Max(rgb.r, rgb.g), rgb.b)
+		min = Math.Min(Math.Min(rgb.r, rgb.g), rgb.b)
+		d = max - min
+		If rgb.g = max Then
+			Return ((rgb.b - rgb.r) As Double / d * 60.0 + 120.0) As GLdouble
+		ElseIf rgb.b = max Then
+			Return ((rgb.r - rgb.g) As Double / d * 60.0 + 240.0) As GLdouble
+		ElseIf rgb.g < rgb.b Then
+			Return ((rgb.g - rgb.b) As Double / d * 60.0 + 360.0) As GLdouble
+		Else
+			Return ((rgb.g - rgb.b) As Double / d * 60.0) As GLdouble
+		EndIf
+	End Function
+
+	Function GetSaturation() As GLdouble
+		Dim max As GLdouble, min As GLdouble
+		max = Math.Max(Math.Max(rgb.r, rgb.g), rgb.b)
+		min = Math.Min(Math.Min(rgb.r, rgb.g), rgb.b)
+		Return (max - min) / max
+	End Function
+
+	Function GetVolue() As GLdouble
+		Dim max As GLdouble
+		max = Math.Max(Math.Max(rgb.r, rgb.g), rgb.b)
+		Return max
+	End Function
+
+Public /* static method */
+	Static Function FromRGB(r As GLbyte, g As GLbyte, b As GLbyte) As Color4d
+		Dim ret As Color4d(r/255,g/255,b/255,1.0)
+		Return ret
+	End Function
+	Static Function FromCOLORREF(c As COLORREF) As Color4d
+		Dim ret As Color4d((c and &hff)/255,(c>>8 and &hff)/255,(c>>16 and &hff)/255,1.0)
+		Return ret
+	End Function
+	Static Function FromHSV(h As GLdouble, s As GLdouble, v As GLdouble, a As GLdouble) As Color4d
+		Dim r As GLdouble
+		Dim g As GLdouble
+		Dim b As GLdouble
+		Dim a As GLdouble
+		If h<0 Then h+=360.0
+		If h>360.0 Then h-=360.0
+		Select Case (h/60) As Long
+			Case 0
+				r=v
+				g=v*(1-s*(1-(h/60-(h/60) As Long)))
+				b=v*(1-s)
+			Case 1
+				r=v*(1-s*(h/60-(h/60) As Long))
+				g=v
+				b=v*(1-s)
+			Case 2
+				r=v*(1-s)
+				g=v
+				b=v*(1-s*(1-(h/60-(h/60) As Long)))
+			Case 3
+				r=v*(1-s)
+				g=v*(1-s*(h/60-(h/60) As Long))
+				b=v
+			Case 4
+				r=v*(1-s*(1-(h/60-(h/60) As Long)))
+				g=v*(1-s)
+				b=v
+			Case 5
+				r=v
+				g=v*(1-s)
+				b=v*(1-s*(h/60-(h/60) As Long))
+			Case 6
+				r=v
+				g=v*(1-s*(1-(h/60-(h/60) As Long)))
+				b=v*(1-s)
+		End Select
+
+		Dim ret As Color4f(r,g,b,a)
+		Return ret
+	End Function
 
 Public
@@ -1669,13 +1869,21 @@
 		glColor4d(red,green,blue,alpha)
 	End Sub
-
 	Sub Color(red As GLfloat, green As GLfloat, blue As GLfloat)
 		glColor3f(red,green,blue)
 	End Sub
+	Sub Color(red As GLfloat, green As GLfloat, blue As GLfloat, alpha As GLfloat)
+		glColor4f(red,green,blue,alpha)
+	End Sub
 	Sub Color(c As Color3f)
 		glColor3fv(VarPtr(c.rgb))
 	End Sub
-	Sub Color(red As GLfloat, green As GLfloat, blue As GLfloat, alpha As GLfloat)
-		glColor4f(red,green,blue,alpha)
+	Sub Color(c As Color4f)
+		glColor4fv(VarPtr(c.rgba))
+	End Sub
+	Sub Color(c As Color3d)
+		glColor3dv(VarPtr(c.rgb))
+	End Sub
+	Sub Color(c As Color4d)
+		glColor4dv(VarPtr(c.rgba))
 	End Sub
 
