(.using
  [library
   [lux "*"
    ["$" documentation {"+" documentation:}]
    [control
     ["<>" parser
      ["<[0]>" code]]]
    [data
     ["[0]" text {"+" \n}
      ["%" format {"+" format}]]]
    [macro
     [syntax {"+" 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)])

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

(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]))
