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

Re: dark images on a dark bad



jidanni@xxxxxxxxxxx writes:

> Using
> $ cat .Xresources
> Emacs*Background: DarkSlateGray
> Emacs*Foreground: Wheat
>
> Browsing http://en.wikipedia.org/wiki/Earthing_system is difficult, as
> the images end up being dark lines on dark background. One needs to
> use emacs --reverse-video to see them.
>
> There should be a command that can add a white etc. background to all
> images on the page, or some other remedy.

;; 日本語なので jidanni さんを CC にいれていません。

favicon と同じように w3m-create-image() でも画像の背景色を指定できるよう
にするといいかな、と思ったのですがいかがでしょうか?

--
青田

Index: w3m-ems.el
===================================================================
RCS file: /storage/cvsroot/emacs-w3m/w3m-ems.el,v
retrieving revision 1.37
diff -u -r1.37 w3m-ems.el
--- w3m-ems.el	18 Feb 2008 05:13:58 -0000	1.37
+++ w3m-ems.el	17 Jul 2008 17:32:50 -0000
@@ -234,7 +234,9 @@
 				    ((match-beginning 2) 'jpeg)
 				    (t 'png)))
 			 (w3m-image-type type))))
-	  (setq image (create-image (buffer-string) type t :ascent 'center))
+	  (setq image (create-image (buffer-string) type t 
+				    :ascent 'center 
+				    :background w3m-image-default-background))
 	  (if (and w3m-resize-images set-size)
 	      (progn
 		(set-buffer-multibyte t)
Index: w3m.el
===================================================================
RCS file: /storage/cvsroot/emacs-w3m/w3m.el,v
retrieving revision 1.1375
diff -u -r1.1375 w3m.el
--- w3m.el	25 Jun 2008 02:44:28 -0000	1.1375
+++ w3m.el	17 Jul 2008 17:32:53 -0000
@@ -455,6 +455,19 @@
   :type '(radio (const :tag "Auto Detect" nil)
 		(integer :format "Specify Pixels: %v\n" :size 0)))
 
+(defcustom w3m-image-default-background nil
+  "Color name used as transparent color of image.
+Nil means to use the background color of the Emacs frame.  The
+null string \"\" is special, that will be replaced with the
+background color of the buffer. Note that this value is effective
+only with Emacs 22 and greater."
+  :group 'w3m
+  :type '(radio (string :format "Color: %v\n" :size 0
+			:match (lambda (widget value)
+				 (and (stringp value) (> (length value) 0))))
+		(const :tag "Use the background color of the Emacs frame" nil)
+		(const :tag "Null string" "")))
+
 (defvar w3m-accept-japanese-characters
   (and (not noninteractive)
        (featurep 'mule)