Megatest

Diff
Login

Differences From Artifact [2c48b3925f]:

To Artifact [19987744e3]:


14
15
16
17
18
19
20





21
22
23
24






25





26


27
28
29
30
31
32
33
;;     GNU General Public License for more details.
;; 
;;     You should have received a copy of the GNU General Public License
;;     along with Megatest.  If not, see <http://www.gnu.org/licenses/>.
;;
;;======================================================================






(import (prefix iup iup:)
	canvas-draw)

(import srfi-1 regex regex-case srfi-69)












(declare (unit gutils))



;; NOTE: These functions will move to iuputils

(define (gutils:colors-similar? color1 color2)
  (let* ((c1 (map string->number (string-split color1)))
	 (c2 (map string->number (string-split color2)))
	 (delta (map (lambda (a b)(abs (- a b))) c1 c2)))







>
>
>
>
>



|
>
>
>
>
>
>
|
>
>
>
>
>
|
>
>







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
;;     GNU General Public License for more details.
;; 
;;     You should have received a copy of the GNU General Public License
;;     along with Megatest.  If not, see <http://www.gnu.org/licenses/>.
;;
;;======================================================================

(declare (unit gutils))

(module gutils
	*
	
(import (prefix iup iup:)
	canvas-draw)

(import scheme
	 chicken.base
	 chicken.condition
	 chicken.string
	 chicken.pretty-print
	 chicken.sort
	 chicken.time
	 
	 chicken.file
	 chicken.file.posix
	 chicken.process
	 chicken.process-context
	 chicken.process-context.posix)

	 
(import srfi-1 regex regex-case srfi-69)

;; NOTE: These functions will move to iuputils

(define (gutils:colors-similar? color1 color2)
  (let* ((c1 (map string->number (string-split color1)))
	 (c2 (map string->number (string-split color2)))
	 (delta (map (lambda (a b)(abs (- a b))) c1 c2)))
86
87
88
89
90
91
92

    ((BOTH-BAD)         (list "180 33 49" status))

    (else               (list
			 ;; "192 192 192"
			 "222 222 221"
			 state))))









>
104
105
106
107
108
109
110
111
    ((BOTH-BAD)         (list "180 33 49" status))

    (else               (list
			 ;; "192 192 192"
			 "222 222 221"
			 state))))

)