View Single Post
Old 05-25-2011, 01:01 PM   #20
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: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
When I did the work to add coloring I thought it was probably a waste of time. Never thought I would say this, but this coloring stuff is kind of fun. While testing it, my wife asked if the color of our custom rating column could depend on who had read the book (two custom boolean columns), green if both of us read it, blue if only me, fuchsia (a dark pink) if only her, and black if neither (??). It actually helps, even with my part color blindness.
Click image for larger version

Name:	Clipboard01.png
Views:	150
Size:	2.8 KB
ID:	71848

Did it by coloring the rating column using the following template:
Code:
program:
  r1 = field('#mybool');
  r2 = field('#mybool2');
  first_non_empty(
    test(and(r1, r2), 'green', ''),
    test(r1, 'blue', ''),
    test(r2, 'fuchsia', ''),
    'black')
(NB: I added the 'and' function (and 'or' and 'not') to the template language to simplify the first expression. These boolean functions will be in the next release.)
chaley is offline   Reply With Quote