Index: dashboard.scm ================================================================== --- dashboard.scm +++ dashboard.scm @@ -2904,18 +2904,17 @@ (vals (map (lambda (x)(vector-ref x 2)) dat))) (if (not (hash-table-exists? graph-matrix-table fieldn)) ;;(print fieldn "exists") (begin (let* ((graph-color-rgb (vg:generate-color-rgb)) - (graph-color (apply vg:rgb->number graph-color-rgb)) + (graph-color (vg:iup-color->number graph-color-rgb)) (graph-matrix-col (dboard:tabdat-graph-matrix-col tabdat)) (graph-matrix-row (dboard:tabdat-graph-matrix-row tabdat))) (hash-table-set! graph-matrix-table fieldn graph-color) (print "Graph data " graph-matrix-row " " graph-matrix-col " " fieldn " " graph-color " " graph-color-rgb) (set! changed #t) (iup:attribute-set! graph-matrix (conc graph-matrix-row ":" graph-matrix-col) fieldn) - (iup:attribute-set! graph-matrix "FGCOLOR1:1" '(70 249 73)) (iup:attribute-set! graph-matrix (conc "BGCOLOR" (conc graph-matrix-row ":" graph-matrix-col)) graph-color-rgb) (if (> graph-matrix-col 10) (begin (dboard:tabdat-graph-matrix-col-set! tabdat 1) (dboard:tabdat-graph-matrix-row-set! tabdat (+ graph-matrix-row 1))) Index: vg.scm ================================================================== --- vg.scm +++ vg.scm @@ -368,20 +368,23 @@ (arithmetic-shift a 24) (arithmetic-shift r 16) (arithmetic-shift g 8) b)) +;; Obsolete function +;; (define (vg:generate-color) (vg:rgb->number (random 255) (random 255) (random 255))) +;; Need to return a string of random iup-color for graph +;; (define (vg:generate-color-rgb) - (list (random 255) - (random 255) - (random 255))) - + (conc (number->string (random 255)) " " + (number->string (random 255)) " " + (number->string (random 255)))) (define (vg:iup-color->number iup-color) (apply vg:rgb->number (map string->number (string-split iup-color)))) ;;======================================================================