View Single Post
Old 01-04-2015, 02:49 AM   #6
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,454
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
For the column contents, the following general program mode template should work:
Code:
program:
	list_union(
		'',
		strcat(
			contains(field('#cola'), 'yes', 'ColA,', ''),
			contains(field('#colb'), 'yes', 'ColB,', ''),
			contains(field('#colc'), 'yes', 'ColC,', ''),
		), ',')
For coloring, you would define a custom coloring rule that looks something like the following. It works because the above template produces the list in a known order.
Code:
program:
	v = field('#composite');
	first_non_empty(
		strcmp(v, '', '', 'azure', ''),
		strcmp(v, 'cola', '', 'orange', ''),
		strcmp(v, 'colb', '', 'red', ''),
		strcmp(v, 'colc', '', 'blue', ''),
		strcmp(v, 'cola, colb', '', 'yellow', ''),
		strcmp(v, 'cola, colc', '', 'pink', ''),
		strcmp(v, 'colb, colc', '', 'mauve', ''),
		strcmp(v, 'cola, colb, colc', '', '#445533', ''),
	)
The last color is an RGB specification. Note that it is very possible that the performance will not be acceptable because of all the tests.
chaley is offline   Reply With Quote