Menu

#5524 New function css-color (accompanying x11-color)

Fixed
Enhancement
2019-07-15
2019-06-03
Urs Liska
No

New function css-color (accompanying x11-color)

I was asked if LilyPond could support choosing colors by their CSS name,
which I found a reasonable wish.

This commit makes make-x11-color-handler generic and specifies
a new function css-color. From this it would be easy to also add further
namespaces and color lists.

CSS colors are case insensitive, so this commit also provides support for
this. Incidentally, a warning is now issued when the requested color is
not defined (instead of silently falling back to black).

https://codereview.appspot.com/580780043/

Discussion

1 2 > >> (Page 1 of 2)
  • Urs Liska

    Urs Liska - 2019-06-03
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -11,29 +11,4 @@
     this. Incidentally, a warning is now issued when the requested color is
     not defined (instead of *silently* falling back to black).
    
    -Only warn about missing color when necessary
    -
    -
    -Merge pull request #6 from rettinghaus/dev/urs/css-fonts
    -
    -add named colors from CSS Color Module Level 4
    -
    -Rename x11-color.scm to color.scm
    -
    -With the previous commit adding `css-color` the file `x11-color.scm` should be
    -rename to the generic `color.scm`.
    -
    -add named colors from CSS Color Module Level 4
    -
    -
    -Define function css-color (accompany x11-color)
    -
    -It should be possible to specify colors using the CSS names in addition to
    -the X11 names.
    -
    -This commit makes `make-x11-color-handler` generic and adds a function
    -`css-color`.
    -What remains to be done is (of course documenting and) filling in the remaining
    -~140 colors.
    -
     http://codereview.appspot.com/570690043
    
    • Needs: -->
     
  • Urs Liska

    Urs Liska - 2019-06-03

    I will document this when review shows no initial objections against the addition

     
  • Urs Liska

    Urs Liska - 2019-06-03

    Test case:

      \override NoteHead.color = #(css-color 'Violet)
      c'1
      \override NoteHead.color = #(x11-color 'DarkCyan)
      d'
    }
    
     
  • Anonymous

    Anonymous - 2019-06-03
    • Patch: new --> review
     
  • Anonymous

    Anonymous - 2019-06-03

    Passes make, make check and a full make doc

     
  • Anonymous

    Anonymous - 2019-06-05
    • Patch: review --> countdown
     
  • Anonymous

    Anonymous - 2019-06-05

    Patch on countdown for Jun 7th

     
  • Urs Liska

    Urs Liska - 2019-06-05
    • Patch: countdown --> needs_work
     
  • Urs Liska

    Urs Liska - 2019-06-05

    Discussion showed there are some conceptual issues to discuss.

     
  • Anonymous

    Anonymous - 2019-06-05
    • Needs: -->
    • Patch: new --> needs_work
    • Type: -->
     
  • Anonymous

    Anonymous - 2019-06-05
     
  • Anonymous

    Anonymous - 2019-06-05

    Reviewers: ,

    Message:
    This is a follow-up patch to
    https://codereview.appspot.com/570690043/

    For some reason it was uploaded as a new patch,
    and Issue
    https://sourceforge.net/p/testlilyissues/issues/5524/
    wasn't updated.

    This new patch attempts a cleaner separation of color
    definitions between X11 and CSS colors, avoiding
    duplication.

    As with the original patch, I'll document it when
    there's basic agreement.

    Description:
    New function css-color

    X11 and CSS colors are now independently accessible through #(x11-color
    <name>)
    or #(css-color <name>).</name></name>

    Both color models are now completely case insensitive (as they should
    be),
    and spaces are simply stripped from the argument. That way all
    combinations
    of symbols/strings, CamelCased or lowercase etc. are accepted.

    If no color is found by the requested name a warning is issued
    (unfortunately that can't be an input warning).

    Please review this at https://codereview.appspot.com/580780043/

     
  • Anonymous

    Anonymous - 2019-06-05
    • Patch: needs_work --> review
    • Type: --> Enhancement
     
  • Anonymous

    Anonymous - 2019-06-05

    Passes make, make check and a full make doc.

     
  • Anonymous

    Anonymous - 2019-06-07
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -11,4 +11,5 @@
     this. Incidentally, a warning is now issued when the requested color is
     not defined (instead of *silently* falling back to black).
    
    -http://codereview.appspot.com/570690043
    +
    +https://codereview.appspot.com/580780043/
    
     
  • Anonymous

    Anonymous - 2019-06-07
    • Patch: review --> countdown
     
  • Anonymous

    Anonymous - 2019-06-07

    Patch on countdown for June 7th

     
  • Anonymous

    Anonymous - 2019-06-09
    • Patch: countdown --> push
     
  • Anonymous

    Anonymous - 2019-06-09

    Patch counted down - please push

     
  • Anonymous

    Anonymous - 2019-06-13

    Patch counted down - please push

     
  • Anonymous

    Anonymous - 2019-06-15
     
  • Anonymous

    Anonymous - 2019-06-15

    Patch counted down - please push

     
  • Anonymous

    Anonymous - 2019-06-19

    Patch counted down - please push

     
  • Anonymous

    Anonymous - 2019-07-09

    Patch counted down - please push

     
  • Anonymous

    Anonymous - 2019-07-14
    • labels: --> Fixed_2_21_0
    • status: Started --> Fixed
    • Patch: push -->
     
1 2 > >> (Page 1 of 2)
MongoDB Logo MongoDB