* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * Website: http://www.chiark.greenend.org.uk/ucgi/~jacobn/git/bedbugs-git/
+ * Website: http://www.chiark.greenend.org.uk/ucgi/~jacobn/git/bedbugs.git/
*
*
* This source file, bedbugs.c, is based on
int size = sizes[size_index], state;
printf("XPM\n/* width height num_colors chars_per_pixel */\n");
printf("\"%d %d 2 1\"\n", size, size*33);
- printf("/* colors */\n\". c #000000\"\n\"A c #FFFFFF\"\n");
+ /* We have to have a non-greyscale colour to trigger Golly's
+ * "multi-colour icon" mode, so that we can make some states'
+ * non-icon versions black. And it's not sufficient to
+ * include an unreferenced, colour, so our 'on' state is
+ * off-white. */
+ printf("/* colors */\n\". c #000000\"\n\"A c #FEFEFF\"\n");
/* icons never used for state 0 */
for (state = 1; state < 34; state++) {
bool *r = blank(size);
}
}
+void colours(void)
+{
+ int i;
+ for (i=0; i<34; i++) {
+ int lvl;
+ switch (i) {
+ case 0:
+ lvl = 0;
+ break;
+ case 1:
+ lvl = 255;
+ break;
+ default:
+ lvl = (i >= 2+16) ? 255 : 0;
+ break;
+ }
+ printf("%2d %3d %3d %3d\n", i, lvl, lvl, lvl);
+ }
+}
+
int main(int argc, char *argv[])
{
while (!feof(stdin)) {
bedstead();
} else if (strncmp(l+2, "ICONS", n) == 0) {
icons();
+ } else if (strncmp(l+2, "COLORS", n) == 0) {
+ colours();
} else {
/* Bodily insert named file on stdout. */
FILE *f;