aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/data/color.lux
blob: 7ad4ed77aae2999fe80621df1a078a63bde59c05 (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
131
132
133
134
135
136
137
138
139
140
141
(.module:
  [library
   [lux "*"
    ["$" documentation {"+" [documentation:]}]
    [control
     ["<>" parser
      ["<.>" code]]]
    [data
     ["." text {"+" [\n]}
      ["%" format {"+" [format]}]]]
    [macro
     [syntax {"+" [syntax:]}]
     ["." code]
     ["." template]]]]
  [\\library
   ["." /]]
  ["." / "_"
   ["#." 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)])

(template [<name>]
  [(documentation: <name>
     ""
     [(<name> ratio color)])]

  [/.darker]
  [/.brighter]
  [/.saturated]
  [/.un_saturated]
  )

(syntax: (palette_documentation [[_ name] <code>.identifier])
  (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.")

(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

             ..darker
             ..brighter
             ..saturated
             ..un_saturated
             
             ..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)]
            [/named.documentation]))