... This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
... If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

(.require
 [library
  [lux (.except)
   ["$" documentation]
   [data
    [collection
     ["[0]" list]]]
   [meta
    [macro
     ["[0]" template]]]]]
 ["[0]" /
  ["[1][0]" binary]
  ["[1][0]" bit]
  ["[1][0]" collection]
  ["[1][0]" color
   ["[1]/[0]" named]]
  ["[1][0]" format]
  ["[1][0]" identity]
  ["[1][0]" product]
  ["[1][0]" sum]
  ["[1][0]" text]])

... (the palette_documentation
...   (syntax.macro (_ [[_ name] <code>.symbol])
...     (in (list (code.text (%.message "A " (text.replaced "_" "-" name) " palette."))))))

... (`` (the .public documentation
...       (List $.Documentation)
...       (let [encoding (list ($.definition /.of_rgb)
...                            ($.definition /.rgb)

...                            ($.definition /.HSL
...                              "Hue-Saturation-Lightness color format.")

...                            ($.definition /.hsl)
...                            ($.definition /.of_hsl)

...                            ($.definition /.hsb)
...                            ($.definition /.of_hsb)

...                            ($.definition /.HSB
...                              "Hue-Saturation-Brightness color format."))
...             transformation (list ($.definition /.gray_scale)
...                                  ($.definition /.darker)
...                                  ($.definition /.brighter)
...                                  ($.definition /.saturated)
...                                  ($.definition /.un_saturated)

...                                  ($.definition /.complement
...                                    "The opposite color."
...                                    ($.example (' (complement color))))

...                                  ($.definition /.interpolated
...                                    ""
...                                    ($.example (' (interpolated ratio end start)))))
...             alpha (list ($.definition /.Alpha
...                           "The degree of transparency of a pigment.")

...                         ($.definition /.transparent
...                           "The maximum degree of transparency.")

...                         ($.definition /.translucent
...                           "The medium degree of transparency.")

...                         ($.definition /.opaque
...                           "The minimum degree of transparency."))
...             scheme (list ($.definition /.Spread)
...                          ($.definition /.Palette)

...                          ($.definition /.analogous
...                            (palette_documentation /.analogous)
...                            ($.example (' (analogous spread variations color))))

...                          ($.definition /.monochromatic
...                            (palette_documentation /.monochromatic)
...                            ($.example (' (monochromatic spread variations color))))

...                          (,, (template.with [<name>]
...                                [(`` ($.definition <name>
...                                       (%.message "A "
...                                               (text.replaced "_" "-" (,, (template.text [<name>])))
...                                               " color scheme.")))]

...                                [/.triad]
...                                [/.clash]
...                                [/.split_complement]
...                                [/.square]
...                                [/.tetradic]
...                                )))]
...         (list.partial ($.module /._
...                                 "")

...                       ($.definition /.Color
...                         "A color value, independent of color format.")

...                       ($.definition /.equivalence)
...                       ($.definition /.hash)
...                       ($.definition /.black)
...                       ($.definition /.white)
...                       ($.definition /.addition)
...                       ($.definition /.subtraction)

...                       ($.definition /.Pigment
...                         "A color with some degree of transparency.")

...                       (all list#composite
...                            encoding
...                            transformation
...                            alpha
...                            scheme

...                            /named.documentation
...                            )
...                       ))))

(the .public documentation
  (List $.Documentation)
  (list.together
   (list /binary.documentation
         /bit.documentation
         /collection.documentation
         /color/named.documentation
         /format.documentation
         /identity.documentation
         /product.documentation
         /sum.documentation
         /text.documentation
         )))
