.colors not working?

Has something gone haywire? Let us know about it!
Post Reply
User avatar
gmc_nxtman
Posts: 1147
Joined: May 26th, 2015, 7:20 pm

.colors not working?

Post by gmc_nxtman » June 1st, 2015, 4:25 pm

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

User avatar
Alexey_Nigin
Posts: 323
Joined: August 4th, 2014, 12:33 pm
Location: Ann Arbor, MI
Contact:

Re: .colors not working?

Post by Alexey_Nigin » June 1st, 2015, 4:34 pm

Code: Select all

@RULE B3_S23
@COLORS
0 255 255 255
1   4  42 128
Save this as B3_S23.rule.
There are 10 types of people in the world: those who understand binary and those who don't.

User avatar
gmc_nxtman
Posts: 1147
Joined: May 26th, 2015, 7:20 pm

Re: .colors not working?

Post by gmc_nxtman » June 1st, 2015, 4:41 pm

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"

fluffykitty
Posts: 638
Joined: June 14th, 2014, 5:03 pm

Re: .colors not working?

Post by fluffykitty » June 1st, 2015, 4:59 pm

Try pasting this into Golly:

Code: Select all

@RULE Life
@COLORS
0 255 255 255
1   4  42 128
I like making rules

User avatar
gmc_nxtman
Posts: 1147
Joined: May 26th, 2015, 7:20 pm

Re: .colors not working?

Post by gmc_nxtman » June 1st, 2015, 6:14 pm

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.

Kitsich
Posts: 1
Joined: July 28th, 2015, 4:45 am
Contact:

Re: .colors not working?

Post by Kitsich » July 28th, 2015, 5:08 am

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.
Success consists of going from failure to failure without loss of enthusiasm. Quotes about success on Wikipedia, Oxford that teach us to be wiser

User avatar
dvgrn
Moderator
Posts: 5874
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: .colors not working?

Post by dvgrn » July 28th, 2015, 4:19 pm

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

User avatar
SuperSupermario24
Posts: 120
Joined: July 22nd, 2014, 12:59 pm
Location: Within the infinite expanses of the Life universe

Re: .colors not working?

Post by SuperSupermario24 » August 5th, 2015, 12:59 am

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.

Code: Select all

bobo2b3o2b2o2bo3bobo$obobobo3bo2bobo3bobo$obobob2o2bo2bobo3bobo$o3bobo3bo2bobobobo$o3bob3o2b2o3bobo2bo!

AbhpzTa
Posts: 475
Joined: April 13th, 2016, 9:40 am
Location: Ishikawa Prefecture, Japan

Re: .colors not working?

Post by AbhpzTa » November 13th, 2016, 11:43 am

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.
????
Iteration of sigma(n)+tau(n)-n [sigma(n)+tau(n)-n : OEIS A163163] (e.g. 16,20,28,34,24,44,46,30,50,49,11,3,3, ...) :
965808 is period 336 (max = 207085118608).

User avatar
dvgrn
Moderator
Posts: 5874
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: .colors not working?

Post by dvgrn » November 13th, 2016, 11:52 am

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.

AbhpzTa
Posts: 475
Joined: April 13th, 2016, 9:40 am
Location: Ishikawa Prefecture, Japan

Re: .colors not working?

Post by AbhpzTa » November 13th, 2016, 12:37 pm

Please tell me how to save .colors/icons files.
Iteration of sigma(n)+tau(n)-n [sigma(n)+tau(n)-n : OEIS A163163] (e.g. 16,20,28,34,24,44,46,30,50,49,11,3,3, ...) :
965808 is period 336 (max = 207085118608).

User avatar
dvgrn
Moderator
Posts: 5874
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: .colors not working?

Post by dvgrn » November 13th, 2016, 12:52 pm

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.

User avatar
Andrew
Moderator
Posts: 763
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: .colors not working?

Post by Andrew » November 13th, 2016, 5:35 pm

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.

Post Reply