[Top][All Lists]

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

Re: Color variables/symbols (was: pygment regex question)

From: Lukas-Fabian Moser
Subject: Re: Color variables/symbols (was: pygment regex question)
Date: Sat, 26 Nov 2022 21:55:28 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2

Am 26.11.22 um 18:35 schrieb Lukas-Fabian Moser:
Am 26.11.22 um 18:11 schrieb David Kastrup:
\override NoteHead.color = red

actually lowers the barrier immensely compared with

\override NoteHead #'color = #red
red and #red are completely different Scheme entities.

Yes indeed (I suspect red gets parsed to #'red, no?).
Of course to #"red".
I never took the time to find out what's happening there behind the scenes, but as a frequent user of the colors "darkred" and "darkgreen", I'm a bit nervous about:

lukas@Aquarium:~/git/lilypond/scm(master)$ git grep darkred
color.scm:    (darkred 0.54509803921568623 0 0)
output-lib.scm:(define-public darkred     '(0.5 0.0 0.0))

lukas@Aquarium:~/git/lilypond/scm(master)$ git grep darkgreen
color.scm:    (darkgreen 0 0.39215686274509803 0)
output-lib.scm:(define-public darkgreen   '(0.0 0.5 0.0))

@everyone: Is this as it should be?
commit 1ea236291f96dbe583059f64a9b3048b413b6e0b
Author: Valentin Villenave <>
Date:   Fri May 22 12:46:11 2020 +0200

    Allow CSS-style colors anywhere

    - Add support for setting the 'color property to a
    string instead of a list (as a grob and a stencil property).
    Hexadecimal color codes may include an alpha channel.

    - rgb-color now accepts an optional fourth channel,
    that is ignored in PostScript output but will result
    in rgba() colors in SVG.

    The next step would be, ideally, to figure out a way
    of enabling semi-transparency also in PDF output.
    Two possible ways would be to use either the
    SetTransparency pdfmark feature, or GhostScript-specific
    functions such as .setopacityalpha.  The latter is
    actually being renamed .setfillconstantalpha, see;f=examples/;hb=HEAD

    - Add the appropriate Scheme functions to parse
    CSS-style color codes, and add support in both PS
    and SVG backends (in SVG the color string gets passed
    directly, thus avoiding any rounding modification).

    - Add input/regression/ for the new
    syntax, and alter input/regression/ to
    include a semi-transparent grob.  Both tests should
    result in the same graphical output in either backend.

    - Update LM, NR and Changes; also document predefined
    CSS colors (previously only available through the
    undocumented css-color function).


reply via email to

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