Editing should only be done in the 2-state phase; mixing smoothed and
unsmoothed states will probably confuse the current rules.
-If you zoom out beyond the point where icons are displayed, everything
-gets blobby as smoothed 'off' cells are currently displayed; you'll
-probably want to turn icons off again.
-
The smoothing algorithm comes from Ben Harris' "Bedstead" font generator,
<http://bjh21.me.uk/bedstead/>. The idea of applying it to cellular
automata is due to Simon Tatham. Implementation is by Jacob Nevins.
anw,aw,asw,zs,zse,ze,zne,zn,zc,1
@COLORS
-255 255 255 255 255 255 white to white
+ 0 0 0 0
+ 1 255 255 255
+ 2 0 0 0
+ 3 0 0 0
+ 4 0 0 0
+ 5 0 0 0
+ 6 0 0 0
+ 7 0 0 0
+ 8 0 0 0
+ 9 0 0 0
+10 0 0 0
+11 0 0 0
+12 0 0 0
+13 0 0 0
+14 0 0 0
+15 0 0 0
+16 0 0 0
+17 0 0 0
+18 255 255 255
+19 255 255 255
+20 255 255 255
+21 255 255 255
+22 255 255 255
+23 255 255 255
+24 255 255 255
+25 255 255 255
+26 255 255 255
+27 255 255 255
+28 255 255 255
+29 255 255 255
+30 255 255 255
+31 255 255 255
+32 255 255 255
+33 255 255 255
@ICONS
XPM
"7 231 2 1"
/* colors */
". c #000000"
-"A c #FFFFFF"
+"A c #FEFEFF"
/* icon for state 1 */
"AAAAAAA"
"AAAAAAA"
"15 495 2 1"
/* colors */
". c #000000"
-"A c #FFFFFF"
+"A c #FEFEFF"
/* icon for state 1 */
"AAAAAAAAAAAAAAA"
"AAAAAAAAAAAAAAA"
"31 1023 2 1"
/* colors */
". c #000000"
-"A c #FFFFFF"
+"A c #FEFEFF"
/* icon for state 1 */
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
Editing should only be done in the 2-state phase; mixing smoothed and
unsmoothed states will probably confuse the current rules.
-If you zoom out beyond the point where icons are displayed, everything
-gets blobby as smoothed 'off' cells are currently displayed; you'll
-probably want to turn icons off again.
-
The smoothing algorithm comes from Ben Harris' "Bedstead" font generator,
<http://bjh21.me.uk/bedstead/>. The idea of applying it to cellular
automata is due to Simon Tatham. Implementation is by Jacob Nevins.
@@mungedlife.table
@COLORS
-255 255 255 255 255 255 white to white
+@@COLORS
@ICONS
@@ICONS
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;