]> gitweb.factorcode.org Git - factor.git/blob - extra/colors/xyz/xyz-tests.factor
0c0b1da834f1c8bf3144bd248ce0c1dd55b0ac24
[factor.git] / extra / colors / xyz / xyz-tests.factor
1 ! Copyright (C) 2014 John Benediktsson
2 ! See http://factorcode.org/license.txt for BSD license
3
4 USING: arrays colors kernel locals math.functions math.ranges
5 sequences tools.test ;
6
7 IN: colors.xyz
8
9 { t } [
10     0.0 1.0 0.1 <range> [| r |
11         0.0 1.0 0.1 <range> [| g |
12             0.0 1.0 0.1 <range> [| b |
13                 r g b 1.0 <rgba> dup >xyza >rgba
14                 [ >rgba-components 4array ] bi@
15                 [ 0.00001 ~ ] 2all?
16             ] all?
17         ] all?
18     ] all?
19 ] unit-test