public int getIndex(BmpColor color) {
        int i = 0;
        for (BmpColor c: colors) {
            if (c.equals(color)) {
                return i;
            }
            i++;
        }
        //this was the only line here:
        return -1;
    }