Andreas Köhler's patch to correctly build a html color value. Fixes

328933.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13428 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
David Hampton 2006-03-01 03:28:49 +00:00
parent 9bf79f4cf8
commit f3a90bdefb
2 changed files with 12 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2006-02-28 David Hampton <hampton@employees.org>
* src/app-utils/options.scm: Andreas Köhler's patch to correctly
build a html color value. Fixes 328933.
2006-02-28 Joshua Sled <jsled@asynchronous.org>
* src/bin/gnucash-bin.c (gnucash_command_line): Terminate

View File

@ -1159,13 +1159,17 @@
(inexact->exact
(min 255.0
(truncate (* (/ 255.0 range) value)))))
(define (number->hex-string number)
(let ((ret (number->string number 16)))
(cond ((< (string-length ret) 2) (string-append "0" ret))
(else ret))))
(let ((red (car color))
(green (cadr color))
(blue (caddr color)))
(string-append
(number->string (html-value red) 16)
(number->string (html-value green) 16)
(number->string (html-value blue) 16))))
(number->hex-string (html-value red))
(number->hex-string (html-value green))
(number->hex-string (html-value blue)))))
(define (gnc:color->html color range)
(string-append "#"