diff --git a/examples/textures/textures_image_generation.c b/examples/textures/textures_image_generation.c index be56ff8e8..8049a578e 100644 --- a/examples/textures/textures_image_generation.c +++ b/examples/textures/textures_image_generation.c @@ -27,9 +27,9 @@ int main(void) InitWindow(screenWidth, screenHeight, "raylib [textures] example - procedural images generation"); - Image verticalGradient = GenImageLinearGradient(screenWidth, screenHeight, 0, RED, BLUE); - Image horizontalGradient = GenImageLinearGradient(screenWidth, screenHeight, 90, RED, BLUE); - Image diagonalGradient = GenImageLinearGradient(screenWidth, screenHeight, 45, RED, BLUE); + Image verticalGradient = GenImageGradientLinear(screenWidth, screenHeight, 0, RED, BLUE); + Image horizontalGradient = GenImageGradientLinear(screenWidth, screenHeight, 90, RED, BLUE); + Image diagonalGradient = GenImageGradientLinear(screenWidth, screenHeight, 45, RED, BLUE); Image radialGradient = GenImageGradientRadial(screenWidth, screenHeight, 0.0f, WHITE, BLACK); Image checked = GenImageChecked(screenWidth, screenHeight, 32, 32, RED, BLUE); Image whiteNoise = GenImageWhiteNoise(screenWidth, screenHeight, 0.5f); diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index 7b69b254a..5af2b9aef 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -6241,7 +6241,7 @@ ] }, { - "name": "GenImageLinearGradient", + "name": "GenImageGradientLinear", "description": "Generate image: linear gradient", "returnType": "Image", "params": [ diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index 6674233c4..e7101f51b 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -4996,7 +4996,7 @@ return { } }, { - name = "GenImageLinearGradient", + name = "GenImageGradientLinear", description = "Generate image: linear gradient", returnType = "Image", params = { diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index 79ae6ce6f..2df71232e 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -2416,8 +2416,8 @@ Function 245: GenImageColor() (3 input parameters) Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: color (type: Color) -Function 246: GenImageLinearGradient() (5 input parameters) - Name: GenImageLinearGradient +Function 246: GenImageGradientLinear() (5 input parameters) + Name: GenImageGradientLinear Return type: Image Description: Generate image: linear gradient Param[1]: width (type: int) diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index bfa007b60..1c77f0266 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -1549,7 +1549,7 @@ - + diff --git a/projects/Geany/raylib.c.tags b/projects/Geany/raylib.c.tags index 99b6dfa62..d41809983 100644 --- a/projects/Geany/raylib.c.tags +++ b/projects/Geany/raylib.c.tags @@ -211,7 +211,7 @@ ImageColorContrast|void|(Image *image, float contrast);| ImageColorBrightness|void|(Image *image, int brightness);| ImageColorReplace|void|(Image *image, Color color, Color replace);| GenImageColor|Image|(int width, int height, Color color);| -GenImageLinearGradient|Image|(int width, int height, int direction, Color start, Color end);| +GenImageGradientLinear|Image|(int width, int height, int direction, Color start, Color end);| GenImageGradientRadial|Image|(int width, int height, float density, Color inner, Color outer);| GenImageChecked|Image|(int width, int height, int checksX, int checksY, Color col1, Color col2);| GenImageWhiteNoise|Image|(int width, int height, float factor);| diff --git a/projects/Notepad++/raylib_npp_parser/raylib_npp.xml b/projects/Notepad++/raylib_npp_parser/raylib_npp.xml index 86d4a07e9..890501f2c 100644 --- a/projects/Notepad++/raylib_npp_parser/raylib_npp.xml +++ b/projects/Notepad++/raylib_npp_parser/raylib_npp.xml @@ -1378,7 +1378,7 @@ - + diff --git a/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h b/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h index ab3c52989..3f8450130 100644 --- a/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h +++ b/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h @@ -317,7 +317,7 @@ RLAPI bool ExportImageAsCode(Image image, const char *fileName); // Image generation functions RLAPI Image GenImageColor(int width, int height, Color color); // Generate image: plain color -RLAPI Image GenImageLinearGradient(int width, int height, int direction, Color start, Color end); // Generate image: linear gradient +RLAPI Image GenImageGradientLinear(int width, int height, int direction, Color start, Color end); // Generate image: linear gradient RLAPI Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer); // Generate image: radial gradient RLAPI Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2); // Generate image: checked RLAPI Image GenImageWhiteNoise(int width, int height, float factor); // Generate image: white noise diff --git a/src/raylib.h b/src/raylib.h index e0c2cbb4f..edc81c341 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1239,7 +1239,7 @@ RLAPI bool ExportImageAsCode(Image image, const char *fileName); // Image generation functions RLAPI Image GenImageColor(int width, int height, Color color); // Generate image: plain color -RLAPI Image GenImageLinearGradient(int width, int height, int direction, Color start, Color end); // Generate image: linear gradient +RLAPI Image GenImageGradientLinear(int width, int height, int direction, Color start, Color end); // Generate image: linear gradient RLAPI Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer); // Generate image: radial gradient RLAPI Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2); // Generate image: checked RLAPI Image GenImageWhiteNoise(int width, int height, float factor); // Generate image: white noise diff --git a/src/rtextures.c b/src/rtextures.c index 4c599a5d9..d1cebe0d4 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -685,7 +685,10 @@ Image GenImageColor(int width, int height, Color color) #if defined(SUPPORT_IMAGE_GENERATION) // Generate image: linear gradient -Image GenImageLinearGradient(int width, int height, int direction, Color start, Color end) +// The direction value specifies the direction of the gradient (in degrees) +// with 0 being vertical (from top to bottom), 90 being horizontal (from left to right). +// The gradient effectively rotates counter-clockwise by the specified amount. +Image GenImageGradientLinear(int width, int height, int direction, Color start, Color end) { Color *pixels = (Color *)RL_MALLOC(width*height*sizeof(Color));