mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Modernise chart colours
This commit changes chart colours from the dated CSS defaults to modern colours as suggested by http://clrs.cc/
This commit is contained in:
parent
22517f98ce
commit
21ea6d56bf
@ -106,12 +106,20 @@
|
||||
value)))
|
||||
|
||||
(define (gnc:assign-colors num-colors)
|
||||
(define base-colors '("red" "orange" "yellow" "green"
|
||||
"cyan" "blue" "purple" "magenta"
|
||||
"orchid" "khaki" "gold" "orange"
|
||||
"red3" "orange3" "yellow3" "green3"
|
||||
"cyan3" "blue3" "purple3" "magenta3"
|
||||
"orchid3" "khaki3" "gold3" "orange3"))
|
||||
;; default CSS colours
|
||||
;; (define base-colors '("red" "orange" "yellow" "green"
|
||||
;; "cyan" "blue" "purple" "magenta"
|
||||
;; "orchid" "khaki" "gold" "orange"
|
||||
;; "red3" "orange3" "yellow3" "green3"
|
||||
;; "cyan3" "blue3" "purple3" "magenta3"
|
||||
;; "orchid3" "khaki3" "gold3" "orange3"))
|
||||
|
||||
;; new base-colors from http://clrs.cc/ and flatuicolors.com
|
||||
(define base-colors (list "#FF4136" "#FF851B" "#FFDC00" "#2ECC40"
|
||||
"#0074D9" "#001f3f" "#85144b" "#7FDBFF"
|
||||
"#F012BE" "#3D9970" "#39CCCC" "#f39c12"
|
||||
"#e74c3c" "#e67e22" "#9b59b6" "#8e44ad"
|
||||
"#16a085" "#d35400"))
|
||||
(define (assign-colors i)
|
||||
(if (<= num-colors i)
|
||||
'()
|
||||
|
@ -479,7 +479,7 @@
|
||||
(append col-labels
|
||||
(list (list-ref columns 2))))
|
||||
(set! col-colors
|
||||
(append col-colors (list "blue")))
|
||||
(append col-colors (list "#0074D9")))
|
||||
(set! all-zeros? #f)))))
|
||||
|
||||
|
||||
@ -495,7 +495,7 @@
|
||||
(append col-labels
|
||||
(list (list-ref columns 7))))
|
||||
(set! col-colors
|
||||
(append col-colors (list "green")))
|
||||
(append col-colors (list "#2ECC40")))
|
||||
(set! all-zeros? #f)))))
|
||||
|
||||
(if (memq 'GLPlot plot-type)
|
||||
@ -515,7 +515,7 @@
|
||||
(append col-labels
|
||||
(list (list-ref columns 5))))
|
||||
(set! col-colors
|
||||
(append col-colors (list "black")))
|
||||
(append col-colors (list "#111111")))
|
||||
|
||||
;; credit
|
||||
(gnc:html-barchart-append-column!
|
||||
@ -525,7 +525,7 @@
|
||||
(append col-labels
|
||||
(list (list-ref columns 6))))
|
||||
(set! col-colors
|
||||
(append col-colors (list "red")))
|
||||
(append col-colors (list "#FF4136")))
|
||||
(set! all-zeros? #f)))))
|
||||
|
||||
(if (not all-zeros?)
|
||||
|
@ -156,7 +156,7 @@
|
||||
(gnc:html-barchart-set-col-labels!
|
||||
chart (list (_ "Budget") (_ "Actual")))
|
||||
(gnc:html-barchart-set-col-colors!
|
||||
chart '("blue" "red"))
|
||||
chart '("#0074D9" "#FF4136"))
|
||||
)
|
||||
;; else
|
||||
(begin
|
||||
@ -169,7 +169,7 @@
|
||||
(gnc:html-linechart-set-col-labels!
|
||||
chart (list (_ "Budget") (_ "Actual")))
|
||||
(gnc:html-linechart-set-col-colors!
|
||||
chart '("blue" "red"))
|
||||
chart '("#0074D9" "#FF4136"))
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -334,9 +334,9 @@
|
||||
))
|
||||
(gnc:html-barchart-set-col-colors!
|
||||
chart (append
|
||||
(if show-in? '("blue") '())
|
||||
(if show-out? '("red") '())
|
||||
(if show-net? '("green") '())
|
||||
(if show-in? '("#0074D9") '())
|
||||
(if show-out? '("#FF4136") '())
|
||||
(if show-net? '("#2ECC40") '())
|
||||
))
|
||||
(gnc:report-percent-done 95)
|
||||
|
||||
|
@ -375,9 +375,9 @@
|
||||
(gnc:html-barchart-set-col-colors!
|
||||
chart (append
|
||||
(if show-sep?
|
||||
'("blue" "red") '())
|
||||
'("#0074D9" "#FF4136") '())
|
||||
(if show-net?
|
||||
'("green") '())))
|
||||
'("#2ECC40") '())))
|
||||
|
||||
;; URLs for income/expense or asset/liabilities bars.
|
||||
;; (if show-sep?
|
||||
|
@ -418,9 +418,9 @@
|
||||
(gnc:html-linechart-set-col-colors!
|
||||
chart (append
|
||||
(if show-sep?
|
||||
'("blue" "red") '())
|
||||
'("#0074D9" "#FF4136") '())
|
||||
(if show-net?
|
||||
'("green") '())))
|
||||
'("#2ECC40") '())))
|
||||
|
||||
;; Set the line width and markers
|
||||
(gnc:html-linechart-set-line-width!
|
||||
|
Loading…
Reference in New Issue
Block a user