Update RingRayLib - raylib.c - Add Function : Color GetColor(int hexValue)
@@ -655,6 +655,25 @@ RING_FUNC(ring_ColorFromHSV)
}
}
+
+RING_FUNC(ring_GetColor)
+{
+ if ( RING_API_PARACOUNT != 1 ) {
+ RING_API_ERROR(RING_API_MISS1PARA);
+ return ;
+ }
+ if ( ! RING_API_ISNUMBER(1) ) {
+ RING_API_ERROR(RING_API_BADPARATYPE);
+ return ;
+ }
+ {
+ Color *pValue ;
+ pValue = (Color *) ring_state_malloc(((VM *) pPointer)->pRingState,sizeof(Color)) ;
+ *pValue = GetColor( (int ) RING_API_GETNUMBER(1));
+ RING_API_RETMANAGEDCPOINTER(pValue,"Color",ring_state_free);
+ }
+}
+
RING_API void ringlib_init(RingState *pRingState)
{
ring_vm_funcregister("initwindow",ring_InitWindow);
@@ -709,4 +728,5 @@ RING_API void ringlib_init(RingState *pRingState)
ring_vm_funcregister("colornormalize",ring_ColorNormalize);
ring_vm_funcregister("colortohsv",ring_ColorToHSV);
ring_vm_funcregister("colorfromhsv",ring_ColorFromHSV);
+ ring_vm_funcregister("getcolor",ring_GetColor);
}
