diff --git a/src/graphics.c b/src/graphics.c index fe1eef5..3b656fe 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -39,7 +39,7 @@ static int getColorFromArgs(lua_State *L, int *rgb, const int *def) { g = luaL_checkint(L, 2); b = luaL_checkint(L, 3); } - int idx = palette_colorIdx(r, g, b); + int idx = palette_colorToIdx(r, g, b); if (idx < 0) { luaL_error(L, "color palette exhausted: use fewer unique colors"); } diff --git a/src/image.c b/src/image.c index 46fa2a4..0d3b35b 100644 --- a/src/image.c +++ b/src/image.c @@ -61,7 +61,7 @@ const char *image_init(image_t *self, const char *filename) { int g = p[1]; int b = p[2]; int a = p[3]; - int idx = palette_colorIdx(r, g, b); + int idx = palette_colorToIdx(r, g, b); if (idx < 0) { errmsg = "color palette exhausted: use fewer unique colors"; goto fail; diff --git a/src/palette.c b/src/palette.c index 8c29051..989bfb4 100644 --- a/src/palette.c +++ b/src/palette.c @@ -40,7 +40,7 @@ static unsigned hash(const void *data, int size) { } -int palette_colorIdx(int r, int g, int b) { +int palette_colorToIdx(int r, int g, int b) { palette_init(); /* Make 18bit rgb color (6bits per-channel) from 8bit channels */ diff --git a/src/palette.h b/src/palette.h index 5fc7cbc..dfeac64 100644 --- a/src/palette.h +++ b/src/palette.h @@ -3,6 +3,6 @@ void palette_init(void); void palette_reset(void); -int palette_colorIdx(int r, int g, int b); +int palette_colorToIdx(int r, int g, int b); #endif