aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/data/color.lux
blob: f68e4ed8919ddc498d145776f077e996c746186f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
(.using
 [library
  [lux (.except)
   ["$" documentation (.only documentation:)]
   [control
    ["<>" parser (.only)
     ["<[0]>" code]]]
   [data
    ["[0]" text (.only \n)
     ["%" \\format (.only format)]]]
   [macro
    [syntax (.only syntax)]
    ["[0]" code]
    ["[0]" template]]]]
 [\\library
  ["[0]" /]]
 ["[0]" /
  ["[1][0]" named]])

(documentation: /.RGB
  "Red-Green-Blue color format.")

(documentation: /.HSL
  "Hue-Saturation-Lightness color format.")

(documentation: /.CMYK
  "Cyan-Magenta-Yellow-Key color format.")

(documentation: /.HSB
  "Hue-Saturation-Brightness color format.")

(documentation: /.Color
  "A color value, independent of color format.")

(documentation: /.complement
  "The opposite color."
  [(complement color)])

(documentation: /.interpolated
  ""
  [(interpolated ratio end start)])

(def: palette_documentation
  (syntax (_ [[_ name] <code>.symbol])
    (in (list (code.text (format "A " (text.replaced "_" "-" name) " palette."))))))

(documentation: /.analogous
  (palette_documentation /.analogous)
  [(analogous spread variations color)])

(documentation: /.monochromatic
  (palette_documentation /.monochromatic)
  [(monochromatic spread variations color)])

(documentation: /.Alpha
  "The degree of transparency of a pigment.")

(documentation: /.transparent
  "The maximum degree of transparency.")

(documentation: /.translucent
  "The average degree of transparency.")

(documentation: /.opaque
  "The minimum degree of transparency.")

(documentation: /.Pigment
  "A color with some degree of transparency.")

(with_template [<name>]
  [(`` (documentation: <name>
         (format "A "
                 (text.replaced "_" "-" (~~ (template.text [<name>])))
                 " color scheme.")))]

  [/.triad]
  [/.clash]
  [/.split_complement]
  [/.square]
  [/.tetradic]
  )

(.def: .public documentation
  (.List $.Module)
  ($.module /._
            ""
            [..RGB
             ..HSL
             ..CMYK
             ..HSB
             ..Color
             ..complement
             ..interpolated
             
             ..analogous
             ..monochromatic
             ..Alpha
             ..transparent
             ..translucent
             ..opaque
             ..Pigment

             ..triad
             ..clash
             ..split_complement
             ..square
             ..tetradic

             ($.default /.of_rgb)
             ($.default /.rgb)
             ($.default /.equivalence)
             ($.default /.hash)
             ($.default /.black)
             ($.default /.white)
             ($.default /.addition)
             ($.default /.subtraction)
             ($.default /.hsl)
             ($.default /.of_hsl)
             ($.default /.hsb)
             ($.default /.of_hsb)
             ($.default /.cmyk)
             ($.default /.of_cmyk)
             ($.default /.gray_scale)
             ($.default /.Spread)
             ($.default /.Palette)
             ($.default /.darker)
             ($.default /.brighter)
             ($.default /.saturated)
             ($.default /.un_saturated)]
            [/named.documentation]))