View Single Post
Old 02-07-2022, 05:17 AM   #337
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,510
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
On the topic of that single-column rule:

Code:
program:

	if readstatus()=='currentlyreading' then
		read = $$#lastread;
		updated = $$#fanficupdated;

		if fanfic_unreadchaps()==#1 && $$#percentread==#99 then '#00aaff' 
		elif fanfic_unreadchaps()==#1 && days_between (read, updated) <#0 then '#00d400'
		elif fanfic_unreadchaps()>=#1 && days_between (read, updated) <#0 then '#ffff7f' 
		fi
	
	else colours_daysbetween($#lastread, '#00aaff', '#69cfff', '#9bdeff')
	
	fi
If the colours_daybetween on line 12 is outside the inner fi (line 10), it doesn't colour currentlyreadings that don't match the other rules. But if I put it inside the fi it only colours currentlyreadings. Do I need to duplicate that line?
It isn't clear to me what you want to do. If you want the color in the else clause to be used if no other color is selected then this would do it.
Code:
program:

	colour = if readstatus()=='currentlyreading' then
		read = $$#lastread;
		updated = $$#fanficupdated;

		if fanfic_unreadchaps()==#1 && $$#percentread==#99 then '#00aaff' 
		elif fanfic_unreadchaps()==#1 && days_between (read, updated) <#0 then '#00d400'
		elif fanfic_unreadchaps()>=#1 && days_between (read, updated) <#0 then '#ffff7f' 
		fi
	fi;
	if !colour then colour = colours_daysbetween($#lastread, '#00aaff', '#69cfff', '#9bdeff')
	fi;
	colour
chaley is offline   Reply With Quote