[Remind-Fans] colorizing caldendars

Ruthard Baudach ruthard.baudach at web.de
Mon Apr 30 15:53:04 EDT 2012


>== Auszüge aus der Nachricht von  David F. Skoll vom 2012-04-29 20:31:
> On Sun, 29 Apr 2012 18:22:26 +0200
> Ruthard Baudach <ruthard.baudach at web.de> wrote:
> 
> > I'd like to colorize the Remind message with ANSI Escape sequences, as
> > proposed in the examples directory of the remind source.
> 
> You can use the SPECIAL COLOR for that.  For example:
> 
> REM Wed SPECIAL COLOR 0 0 160 This is BLUE
> 
> will produce a blue calendar entry when run via:
> 
>      rem -clc
Hm -- Read The Manual in other words, even if the first sentence says
there is nothing interesting for you in that paragraph...

Thank you for your fast reply, I'll be able to use remind as I want
then.

Yet--
I'd prefer to put the ANSI Escape Sequences in user defined functions --
something like

fset birthday(name,yr)		CHAR(27) + "[0;35m* " + name + " (" +
(year(trigdate()) -yr) + ")" + CHAR(27) + "[0m"

So that

REM 1 Jan MSG [birthday("My Dear Friend",1900)]

yields a magenta entry

* My Dear Friend (112)



fset birthday(name,yr)	"SPECIAL COLOR 100 0 100 * " + name + " (" +
(year(trigdate()) - yr) + ")"

used in

REM 1 Jan [birthday("My Dear Friend",1900)]

does not work because of an implicit "MSG" remind assumes after a
trigger date.

> 
> See the source code "src/calendar.c" (specifically, the "Colorize"
> function) for the algorithm Remind uses to map RGB triplets to ANSI
> escape sequences.
> 
> Short version: If any of  R, G or B component is greater than 64, that
> component is "on".  If any is greater than 128, then the result is considered
> "bright".  The 16 combinations of "bright", "red-on", "green-on" and
> "blue-on" are mapped to 16 corresponding ANSI escape sequences.

Thanks for the hint,

Greetings,

Ruthard


More information about the Remind-fans mailing list