Page 1 of 1

.colors not working?

Posted: June 1st, 2015, 4:25 pm
by gmc_nxtman
I'm trying to change the colors for the RuleLoader implementation of life, but when I save these strings of text into "life.colors" in my Rules folder, nothing happens, even after restarting golly:

@COLORS
0 255 255 255
1 4 42 128

Re: .colors not working?

Posted: June 1st, 2015, 4:34 pm
by Alexey_Nigin

Code: Select all

@RULE B3_S23
@COLORS
0 255 255 255
1   4  42 128
Save this as B3_S23.rule.

Re: .colors not working?

Posted: June 1st, 2015, 4:41 pm
by gmc_nxtman
Shouldn't it be B3_S23.colors? Anyway, it doesn't work...... sorry. :oops: It has the same error that appears when you enter an invalid rule: "Error: The given rule is not valid in any algorithm"

Re: .colors not working?

Posted: June 1st, 2015, 4:59 pm
by fluffykitty
Try pasting this into Golly:

Code: Select all

@RULE Life
@COLORS
0 255 255 255
1   4  42 128

Re: .colors not working?

Posted: June 1st, 2015, 6:14 pm
by gmc_nxtman
Thanks! :wink:

Now, is there a way to convert any life-like cellular automaton rulestring to a .table format? I think there might be python script for this but I'm not sure.

Re: .colors not working?

Posted: July 28th, 2015, 5:08 am
by Kitsich
gmc_nxtman wrote:Thanks! :wink:

Now, is there a way to convert any life-like cellular automaton rulestring to a .table format? I think there might be python script for this but I'm not sure.
There is no python script there.

Re: .colors not working?

Posted: July 28th, 2015, 4:19 pm
by dvgrn
gmc_nxtman wrote:...is there a way to convert any life-like cellular automaton rulestring to a .table format? I think there might be python script for this but I'm not sure.
It wouldn't be terribly difficult to write a generalized table-generating Python script. Here's a sample of the kind of output the script would generate:

Code: Select all

@RULE B3678_S34678

Sample conversion of a Life-like rule (Day and Night) to table format
(As usual, just copy all this text, then in Golly choose File > Open Clipboard.)

state 0:  OFF
state 1:  ON

@TABLE

n_states:2
neighborhood:Moore
symmetries:permute

var a={0,1}
var b={0,1}
var c={0,1}
var d={0,1}
var e={0,1}
var f={0,1}
var g={0,1}
var h={0,1}
var i={0,1}

# 3-neighbor birth
0,1,1,1,0,0,0,0,0,1

# 6-neighbor birth
0,1,1,1,1,1,1,0,0,1

# 7-neighbor birth
0,1,1,1,1,1,1,1,0,1

# 8-neighbor birth
0,1,1,1,1,1,1,1,1,1

# 3-neighbor survival
1,1,1,1,0,0,0,0,0,1

# 4-neighbor survival
1,1,1,1,1,0,0,0,0,1

# 6-neighbor survival
1,1,1,1,1,1,1,0,0,1

# 7-neighbor survival
1,1,1,1,1,1,1,1,0,1

# 8-neighbor survival
1,1,1,1,1,1,1,1,1,1

# all other cells die
a,b,c,d,e,f,g,h,i,0

@COLORS

1  216  255  216

@ICONS

XPM
/* width height num_colors chars_per_pixel */
"31 31 5 1"
/* colors */
". c #000000"
"B c #404040"
"C c #808080"
"D c #C0C0C0"
"E c #FFFFFF"
/* icon for state 1 */
"..............................."
"..............................."
"..........BCDEEEEEDCB.........."
".........CEEEEEEEEEEEC........."
".......BEEEEEEEEEEEEEEEB......."
"......DEEEEEEEEEEEEEEEEED......"
".....DEEEEEEEEEEEEEEEEEEED....."
"....BEEEEEEEEEEEEEEEEEEEEEB...."
"....EEEEEEEEEEEEEEEEEEEEEEE...."
"...CEEEEEEEEEEEEEEEEEEEEEEEC..."
"..BEEEEEEEEEEEEEEEEEEEEEEEEEB.."
"..CEEEEEEEEEEEEEEEEEEEEEEEEEC.."
"..DEEEEEEEEEEE...EEEEEEEEEEED.."
"..EEEEEEEEEEE.....EEEEEEEEEEE.."
"..EEEEEEEEEE.......EEEEEEEEEE.."
"..EEEEEEEEEE.......EEEEEEEEEE.."
"..EEEEEEEEEE.......EEEEEEEEEE.."
"..EEEEEEEEEEE.....EEEEEEEEEEE.."
"..DEEEEEEEEEEE...EEEEEEEEEEED.."
"..CEEEEEEEEEEEEEEEEEEEEEEEEEC.."
"..BEEEEEEEEEEEEEEEEEEEEEEEEEB.."
"...CEEEEEEEEEEEEEEEEEEEEEEEC..."
"....EEEEEEEEEEEEEEEEEEEEEEE...."
"....BEEEEEEEEEEEEEEEEEEEEEB...."
".....DEEEEEEEEEEEEEEEEEEED....."
"......DEEEEEEEEEEEEEEEEED......"
".......BEEEEEEEEEEEEEEEB......."
".........CEEEEEEEEEEEC........."
"..........BCDEEEEEDCB.........."
"..............................."
"..............................."

XPM
/* width height num_colors chars_per_pixel */
"15 15 5 1"
/* colors */
". c #000000"
"B c #404040"
"C c #808080"
"D c #C0C0C0"
"E c #FFFFFF"
/* icon for state 1 */
"..............."
"....BDEEEDB...."
"...DEEEEEEED..."
"..DEEEEEEEEED.."
".BEEEEEEEEEEEB."
".DEEEEEEEEEEED."
".EEEEE...EEEEE."
".EEEEE...EEEEE."
".EEEEE...EEEEE."
".DEEEEEEEEEEED."
".BEEEEEEEEEEEB."
"..DEEEEEEEEED.."
"...DEEEEEEED..."
"....BDEEEDB...."
"..............."

XPM
/* width height num_colors chars_per_pixel */
"7 7 6 1"
/* colors */
". c #000000"
"B c #404040"
"C c #808080"
"D c #C0C0C0"
"E c #FFFFFF"
"F c #E0E0E0"
/* icon for state 1 */
".BFEFB."
"BEEEEEB"
"FEE.EEF"
"EE...EE"
"FEE.EEF"
"BEEEEEB"
".BFEFB."
Obviously this definition could be rewritten more cleverly with a shorter table. For example, the whole Day and Night table above could be rewritten like this:

Code: Select all

# 3-, 6-, 7-, and 8-neighbor birth and survival
a,1,1,1,0,0,0,0,0,1
a,1,1,1,1,1,1,0,0,1
a,1,1,1,1,1,1,1,0,1
a,1,1,1,1,1,1,1,1,1

# 4-neighbor survival
1,1,1,1,1,0,0,0,0,1

# all other cells die
a,b,c,d,e,f,g,h,i,0
But slightly different tricks would be needed for different rules, to use variables to group the lines correctly. It would make for a simpler script to go in the other direction.

With a less clever definition, you don't even need variables, and you can produce a table for any Life-like rule just by changing the last characters in every line in the table to 0 or 1 as appropriate:

Code: Select all

@TABLE

n_states:2
neighborhood:Moore
symmetries:permute

#C OFF cells -- 1 at the end for birth conditions
0,0,0,0,0,0,0,0,0,0
0,1,0,0,0,0,0,0,0,0
0,1,1,0,0,0,0,0,0,0
0,1,1,1,0,0,0,0,0,1
0,1,1,1,1,0,0,0,0,0
0,1,1,1,1,1,0,0,0,0
0,1,1,1,1,1,1,0,0,1
0,1,1,1,1,1,1,1,0,1
0,1,1,1,1,1,1,1,1,1
#C ON cells -- 1 at the end for survival conditions
1,0,0,0,0,0,0,0,0,0
1,1,0,0,0,0,0,0,0,0
1,1,1,0,0,0,0,0,0,0
1,1,1,1,0,0,0,0,0,1
1,1,1,1,1,0,0,0,0,1
1,1,1,1,1,1,0,0,0,0
1,1,1,1,1,1,1,0,0,1
1,1,1,1,1,1,1,1,0,1
1,1,1,1,1,1,1,1,1,1

Re: .colors not working?

Posted: August 5th, 2015, 12:59 am
by SuperSupermario24
Just to be clear: you are aware that Golly no longer (officially) uses .color or .table or any of those file extensions, right? All those are combined into the .rule format now.

Re: .colors not working?

Posted: November 13th, 2016, 11:43 am
by AbhpzTa
In Golly 2.8
LifeHistory (and some rules) icon colors do not work.
Sometimes one color, sometimes multicolored cells (vertical stripes).
They work in Golly 2.5 , though.
????

Re: .colors not working?

Posted: November 13th, 2016, 11:52 am
by dvgrn
AbhpzTa wrote:In Golly 2.8
LifeHistory (and some rules) icon colors do not work.
Sometimes one color, sometimes multicolored cells (vertical stripes).
They work in Golly 2.5 , though.
????
I've been using LifeHistory in Golly 2.8 for quite a while now, without seeing any of these problems. But it all does sound vaguely familiar. I may well have forgotten something I used to know about this...!

Are you using .table or .colors or .icons files with Golly 2.8, instead of the new combined .rule files ? If so, what happens if you use those files to build a standard .rule file, or use the LifeHistory.rule supplied with Golly 2.8?

It seems possible that you've ended up with an old leftover LifeHistory.icons or some such, wherever you have Golly's default Rules folder set up (?) and it's trying to work with that instead of finding {root Golly directory}/Rules/LifeHistory.rule.

Re: .colors not working?

Posted: November 13th, 2016, 12:37 pm
by AbhpzTa
Please tell me how to save .colors/icons files.

Re: .colors not working?

Posted: November 13th, 2016, 12:52 pm
by dvgrn
AbhpzTa wrote:Please tell me how to save .colors/icons files.
If I'm understanding the question correctly -- see SuperSupermario24's link to .rule format, above. The idea is to build one file, with a .rule extension, that contains all the .table and .colors and .icons pieces that used to be in separate files. It makes it a lot easier to move rules around, quote them in forum posts, and so on.

Start the rule file with @RULE and the name of the rule.
If you have an existing .table file, put it in a @TABLE section of the .rule file.
If you have an existing .colors file, put it in a @COLORS section of the .rule file.
If you have an existing .icons file, put it in an @ICONS section of the .rule file.

That's really pretty much all there is to it, I think. Let me know if you have more specific questions -- maybe attach or quote whatever files you're having trouble with.

Re: .colors not working?

Posted: November 13th, 2016, 5:35 pm
by Andrew
AbhpzTa wrote:Please tell me how to save .colors/icons files.
Forget trying to use .colors/icons files -- eventually Golly will stop supporting them. In 2.8 you can select Control > Convert Old Rules to automatically create .rule files from any .table/tree/colors/icons files. At the end of the process you'll be asked if you want Golly to delete those files. My advice is to click Yes (do a backup of your rules folder first if you really want to keep them).

See Help > File Formats for a detailed description of the .rule format if you want to change the colors/icons for an existing rule.