summaryrefslogtreecommitdiff
path: root/src/textures.c
diff options
context:
space:
mode:
authorjussi2022-02-21 19:05:05 +0200
committerjussi2022-02-21 19:05:05 +0200
commit612ede6da40550fc0b14c1370f616fc6e83df550 (patch)
tree788e0d00820ee85209506c78ec76d397a617cd03 /src/textures.c
parent8182a5f1b6c61bdf95d32a4ad102e1762f0d0924 (diff)
downloadreilua-enhanced-612ede6da40550fc0b14c1370f616fc6e83df550.tar.gz
reilua-enhanced-612ede6da40550fc0b14c1370f616fc6e83df550.tar.bz2
reilua-enhanced-612ede6da40550fc0b14c1370f616fc6e83df550.zip
Documentation. waving_cubes example and RL_DrawFPS and RL_ColorFromHSV.
Diffstat (limited to 'src/textures.c')
-rw-r--r--src/textures.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/textures.c b/src/textures.c
index b147fff..f28bd0f 100644
--- a/src/textures.c
+++ b/src/textures.c
@@ -1055,3 +1055,26 @@ int ltexturesGetTextureSize( lua_State *L ) {
return 1;
}
+
+/*
+## Textures - Color/pixel
+*/
+
+/*
+> color = RL_ColorFromHSV( float hue, float saturation, float value )
+
+Returns a Color from HSV values, hue [0..360], saturation/value [0..1]
+
+- Failure return false
+- Success return Color
+*/
+int ltexturesColorFromHSV( lua_State *L ) {
+ if ( !lua_isnumber( L, -3 ) || !lua_isnumber( L, -2 ) || !lua_isnumber( L, -1 ) ) {
+ TraceLog( LOG_WARNING, "%s", "Bad call of function. RL_ColorFromHSV( float hue, float saturation, float value )" );
+ lua_pushboolean( L, false );
+ return 1;
+ }
+ uluaPushColor( L, ColorFromHSV( lua_tonumber( L, -3 ), lua_tonumber( L, -2 ), lua_tonumber( L, -1 ) ) );
+
+ return 1;
+}