Renamed palette_colorIdx -> palette_colorToIdx

This commit is contained in:
rxi
2016-09-26 20:14:17 +01:00
parent 9ef23e88d7
commit eee7fccb82
4 changed files with 4 additions and 4 deletions

View File

@@ -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");
}

View File

@@ -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;

View File

@@ -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 */

View File

@@ -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