unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#51556: 29.0.50; Poor contrast of Customize SVG icons with dark backgrounds
@ 2021-11-01 17:56 Kévin Le Gouguec
  2021-11-01 19:14 ` Eli Zaretskii
  0 siblings, 1 reply; 26+ messages in thread
From: Kévin Le Gouguec @ 2021-11-01 17:56 UTC (permalink / raw)
  To: 51556

[-- Attachment #1: Type: text/plain, Size: 2526 bytes --]

On darker themes (e.g. modus-vivendi), the Customize SVG icons
(etc/images/right.svg and etc/images/down.svg) are not very visible, due
to the poor contrast between their fill color (#2e3436) and dark
backgrounds[1].

Empirically, AFAICT, the "nuclear" solution of removing "fill:#2e3436"
from the SVG files causes the icons to render with the foreground color
of the default face.  That solves the contrast problem, but maybe a more
subtle solution could be devised?

Once the "fill:…" bit is removed, it becomes possible to change the SVG
image's color, either when calling create-image[2], or by applying
faces[3].

A quick dive into widget-create-child-and-convert (down to
widget-image-insert) suggests that there's no way to tell widget.el to
slap a face onto an image; perhaps a new keyword could be added to that
effect?

Then we could add a face that (1) could preserve the original color
(#2e3436) for light backgrounds (2) be set to something more reasonable
for dark backgrounds (3) be themed.

I wouldn't mind working on that (time permitting); I'd like to collect
some feedback first to make sure what I suggest is the right approach;
maybe there are better solutions I haven't considered.

Thanks for your time.


[1] https://webaim.org/resources/contrastchecker/?fcolor=2E3436&bcolor=000000

[2] E.g. after saving the attached rightnofill.svg, evaluate
    (insert-image (create-image "rightnofill.svg"
                                nil nil :foreground "orange"))

[3] E.g. after saving the attached rightnofill.svg, evaluate
    (insert-image (create-image "rightnofill.svg"))
    (add-text-properties (point-at-bol) (point-at-eol) '(font-lock-face success))


In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.16.0)
 of 2021-10-30 built on amdahl30
Repository revision: c30f95078c0735447c0bf293f2e6f573bc7057a3
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: openSUSE Tumbleweed

Configured using:
 'configure --with-cairo --with-gconf'

Configured features:
ACL CAIRO DBUS FREETYPE GCONF GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ
JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES
NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF
TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=local
  locale-coding-system: utf-8-unix


[-- Attachment #2: rightnofill.svg --]
[-- Type: image/svg+xml, Size: 4878 bytes --]

<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:dc='http://purl.org/dc/elements/1.1/' sodipodi:docname='pan-end-symbolic.svg' inkscape:export-filename='/home/sam/source-symbolic.png' inkscape:export-xdpi='270' inkscape:export-ydpi='270' height='16' id='svg7384' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' style='enable-background:new' xmlns:svg='http://www.w3.org/2000/svg' version='1.1' inkscape:version='1.0 (4035a4fb49, 2020-05-01)' width='16' xmlns='http://www.w3.org/2000/svg'>
  <sodipodi:namedview inkscape:bbox-nodes='true' inkscape:bbox-paths='false' bordercolor='#000000' borderlayer='false' borderopacity='0.50196078' inkscape:current-layer='layer10' inkscape:cx='31.147668' inkscape:cy='7.96251' inkscape:document-rotation='0' gridtolerance='10' inkscape:guide-bbox='true' guidetolerance='10' id='namedview88' inkscape:measure-end='0,0' inkscape:measure-start='0,0' inkscape:object-nodes='true' inkscape:object-paths='true' objecttolerance='10' pagecolor='#e2e2e2' inkscape:pageopacity='0' inkscape:pageshadow='2' showborder='false' showgrid='true' showguides='false' inkscape:showpageshadow='false' inkscape:snap-bbox='true' inkscape:snap-bbox-edge-midpoints='false' inkscape:snap-bbox-midpoints='true' inkscape:snap-center='false' inkscape:snap-global='true' inkscape:snap-grids='true' inkscape:snap-intersection-paths='false' inkscape:snap-midpoints='true' inkscape:snap-nodes='true' inkscape:snap-object-midpoints='true' inkscape:snap-others='true' inkscape:snap-page='false' inkscape:snap-smooth-nodes='true' inkscape:snap-to-guides='true' inkscape:window-height='1205' inkscape:window-maximized='0' inkscape:window-width='1553' inkscape:window-x='26' inkscape:window-y='23' inkscape:zoom='1'>
    <inkscape:grid color='#000000' dotted='false' empcolor='#0800ff' empopacity='0.4627451' empspacing='4' enabled='true' id='grid4866' opacity='0.16470588' originx='-112.00585' originy='-951.99999' snapvisiblegridlinesonly='true' spacingx='1' spacingy='1' type='xygrid' visible='true'/>
    <inkscape:grid dotted='true' empcolor='#3f3fff' empopacity='0' empspacing='4' id='grid3540' originx='-112.00585' originy='-951.99999' spacingx='0.5' spacingy='0.5' type='xygrid'/>
  </sodipodi:namedview>
  <metadata id='metadata90'>
    <rdf:RDF>
      <cc:Work rdf:about=''>
        <dc:format>image/svg+xml</dc:format>
        <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/>
        <dc:title>Gnome Symbolic Icons</dc:title>
        <cc:license rdf:resource='http://creativecommons.org/licenses/by-sa/4.0/'/>
      </cc:Work>
      <cc:License rdf:about='http://creativecommons.org/licenses/by-sa/4.0/'>
        <cc:permits rdf:resource='http://creativecommons.org/ns#Reproduction'/>
        <cc:permits rdf:resource='http://creativecommons.org/ns#Distribution'/>
        <cc:requires rdf:resource='http://creativecommons.org/ns#Notice'/>
        <cc:requires rdf:resource='http://creativecommons.org/ns#Attribution'/>
        <cc:permits rdf:resource='http://creativecommons.org/ns#DerivativeWorks'/>
        <cc:requires rdf:resource='http://creativecommons.org/ns#ShareAlike'/>
      </cc:License>
    </rdf:RDF>
  </metadata>
  <title id='title8473'>Gnome Symbolic Icons</title>
  <defs id='defs7386'/>
  <g inkscape:groupmode='layer' id='layer10' inkscape:label='ui' transform='translate(-112.00585,-951.99999)'>
    <path inkscape:connector-curvature='0' d='m 117,966 6.00585,-6.00001 L 117,954 Z' id='path6412' sodipodi:nodetypes='cccc' style='fill-opacity:1;stroke:none'/>
  </g>
  <g inkscape:groupmode='layer' id='layer1' inkscape:label='status' transform='translate(-112.00585,-887.99999)'/>
  <g inkscape:groupmode='layer' id='layer11' inkscape:label='legacy' transform='translate(-112.00585,-951.99999)'/>
  <g inkscape:groupmode='layer' id='layer7' inkscape:label='places' transform='translate(-112.00585,-887.99999)'/>
  <g inkscape:groupmode='layer' id='layer6' inkscape:label='mimetypes' transform='translate(-112.00585,-887.99999)'/>
  <g inkscape:groupmode='layer' id='layer5' inkscape:label='emotes' transform='translate(-112.00585,-887.99999)'/>
  <g inkscape:groupmode='layer' id='layer9' inkscape:label='emblems' transform='translate(-112.00585,-887.99999)'/>
  <g inkscape:groupmode='layer' id='layer2' inkscape:label='devices' transform='translate(-112.00585,-887.99999)'/>
  <g inkscape:groupmode='layer' id='layer8' inkscape:label='categories' transform='translate(-112.00585,-887.99999)'/>
  <g inkscape:groupmode='layer' id='layer3' inkscape:label='apps' transform='translate(-112.00585,-887.99999)'/>
  <g inkscape:groupmode='layer' id='layer4' inkscape:label='actions' transform='translate(-112.00585,-887.99999)'/>
</svg>

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2021-11-04  8:11 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-01 17:56 bug#51556: 29.0.50; Poor contrast of Customize SVG icons with dark backgrounds Kévin Le Gouguec
2021-11-01 19:14 ` Eli Zaretskii
2021-11-01 20:10   ` Kévin Le Gouguec
2021-11-02 12:40     ` Eli Zaretskii
2021-11-01 20:49   ` Jim Porter
2021-11-02 12:49     ` Eli Zaretskii
2021-11-02 14:41       ` Stefan Kangas
2021-11-02 14:59         ` Eli Zaretskii
2021-11-02 15:17           ` Stefan Kangas
2021-11-02 15:26             ` Stefan Kangas
2021-11-02 16:38               ` Eli Zaretskii
2021-11-02 16:43                 ` Lars Ingebrigtsen
2021-11-02 17:01                 ` Stefan Kangas
2021-11-02 17:13                   ` Eli Zaretskii
2021-11-02 17:44                     ` Stefan Kangas
2021-11-02 18:01                       ` Eli Zaretskii
2021-11-02 18:43                         ` Stefan Kangas
2021-11-02 18:53                           ` Eli Zaretskii
2021-11-02 19:26                             ` Stefan Kangas
2021-11-02 18:43                         ` Jim Porter
2021-11-02 18:58                           ` Stefan Kangas
2021-11-02 19:15                             ` Eli Zaretskii
2021-11-02 19:44                               ` Stefan Kangas
2021-11-02 20:19                           ` Alan Third
2021-11-02 22:56                             ` Kévin Le Gouguec
2021-11-04  8:11                             ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).