lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Does anybody use x11-color ?


From: Till Rettig
Subject: Re: Does anybody use x11-color ?
Date: Sun, 09 Dec 2007 15:25:37 +0200
User-agent: Thunderbird 2.0.0.6 (X11/20071022)

Whow,
I guess I just should stop fumbling around. :-[
I didn't realize that filled-box is really filled (because it said something about rounded corners, and I just thought maybe the naming is wrong. Well, I couldn't have done this with scheme anyways...
That's what I was looking for!

Till

Reinhold Kainhofer schrieb:
Am Samstag, 8. Dezember 2007 schrieb Till Rettig:
  
Please have a look at the lilypond example I created using direct post
script commands. It is an ugly hack, I suppose, but might illustrate
what I am after. 
    

Hehe, you know the filled-box function in lilypond? Makes it a lot easier to 
write such an example. Attached are my humble attempts (actually my first 
real scheme programming steps!) to factorize the display out to a function 
(All you scheme expert out there, please correct the snippet so we can learn 
>from your experience!):

~~~~~~~~~ BEGIN LY ~~~~~~~~~
\version "2.11.35"
\header {
  title = "Available X11 colors with examples"
}
#(define-markup-command (colorBox layout props color) (string?)
    "Print a box with the given x11-color as a markup. Syntax: \\colorBox 
#\"x11-color-name\""
    (interpret-markup layout props
      (markup #:with-color (x11-color color) #:filled-box (cons -0.5 10 ) 
(cons -1 3 ) #'1 color)
    )
)

\markup{\colorBox #"CornflowerBlue"}
\markup{\colorBox #"WhiteSmoke"}
\markup{\colorBox #"MistyRose"}
\markup{\colorBox #"DodgerBlue"}
\markup{\colorBox #"SteelBlue"}
\markup{\colorBox #"LightSteelBlue"}
\markup{\colorBox #"PaleTurquoise"}
~~~~~~~~~ END LY ~~~~~~~~~

Actually, the list of all available x11 colors is defined in x11-colors.scm, 
so one might even be able to map a lambda function on this list and 
automatically create the list of all colors without manually listing them...

Of course, the snippet should be extended to show the colors in three columns, 
too... And the spacing might be reduced, and ... (yeah, I'm obviously a 
perfectionist ;-) 

Cheers,
Reinhold

  

_______________________________________________ lilypond-devel mailing list address@hidden http://lists.gnu.org/mailman/listinfo/lilypond-devel

reply via email to

[Prev in Thread] Current Thread [Next in Thread]