... 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/.

(.using
 [library
  [lux (.except)
   ["$" documentation]
   [data
    ["[0]" text (.only)
     ["%" \\injection]]
    [collection
     ["[0]" list (.use "[1]:[0]" monoid)]]]
   [math
    [number
     ["[0]" natural (.use "hex:[0]" hex)]]]
   [meta
    [macro
     ["[0]" template]]]]]
 [\\library
  ["[0]" / (.only)
   [//
    ["[0]" rgb]]]])

(the description
  (template.macro (_ <name>)
    [($.definition <name>
       (let [[red green blue] <name>
             [_ name] (name <name>)]
         (text "R:" (hex:as red)
               " G:" (hex:as green)
               " B:" (hex:as blue)
               " | " (text.replaced "_" " " name))))]))

(`` (the .public documentation
      (List $.Documentation)
      (let [a-c (list (,, (template.with [<name>]
                            [(description <name>)]

                            [[/.alice_blue]
                             [/.antique_white]
                             [/.aqua]
                             [/.aquamarine]
                             [/.azure]
                             [/.beige]
                             [/.bisque]
                             [/.black]
                             [/.blanched_almond]
                             [/.blue]
                             [/.blue_violet]
                             [/.brown]
                             [/.burly_wood]
                             [/.cadet_blue]
                             [/.chartreuse]
                             [/.chocolate]
                             [/.coral]
                             [/.cornflower_blue]
                             [/.cornsilk]
                             [/.crimson]
                             [/.cyan]]
                            )))
            d-k (list (,, (template.with [<name>]
                            [(description <name>)]

                            [[/.dark_blue]
                             [/.dark_cyan]
                             [/.dark_goldenrod]
                             [/.dark_gray]
                             [/.dark_green]
                             [/.dark_khaki]
                             [/.dark_magenta]
                             [/.dark_olive_green]
                             [/.dark_orange]
                             [/.dark_orchid]
                             [/.dark_red]
                             [/.dark_salmon]
                             [/.dark_sea_green]
                             [/.dark_slate_blue]
                             [/.dark_slate_gray]
                             [/.dark_turquoise]
                             [/.dark_violet]
                             [/.deep_pink]
                             [/.deep_sky_blue]
                             [/.dim_gray]
                             [/.dodger_blue]
                             [/.fire_brick]
                             [/.floral_white]
                             [/.forest_green]
                             [/.fuchsia]
                             [/.gainsboro]
                             [/.ghost_white]
                             [/.gold]
                             [/.goldenrod]
                             [/.gray]
                             [/.green]
                             [/.green_yellow]
                             [/.honey_dew]
                             [/.hot_pink]
                             [/.indian_red]
                             [/.indigo]
                             [/.ivory]
                             [/.khaki]]
                            )))
            l-o (list (,, (template.with [<name>]
                            [(description <name>)]

                            [[/.lavender]
                             [/.lavender_blush]
                             [/.lawn_green]
                             [/.lemon_chiffon]
                             [/.light_blue]
                             [/.light_coral]
                             [/.light_cyan]
                             [/.light_goldenrod_yellow]
                             [/.light_gray]
                             [/.light_green]
                             [/.light_pink]
                             [/.light_salmon]
                             [/.light_sea_green]
                             [/.light_sky_blue]
                             [/.light_slate_gray]
                             [/.light_steel_blue]
                             [/.light_yellow]
                             [/.lime]
                             [/.lime_green]
                             [/.linen]
                             [/.magenta]
                             [/.maroon]
                             [/.medium_aquamarine]
                             [/.medium_blue]
                             [/.medium_orchid]
                             [/.medium_purple]
                             [/.medium_sea_green]
                             [/.medium_slate_blue]
                             [/.medium_spring_green]
                             [/.medium_turquoise]
                             [/.medium_violet_red]
                             [/.midnight_blue]
                             [/.mint_cream]
                             [/.misty_rose]
                             [/.moccasin]
                             [/.navajo_white]
                             [/.navy]
                             [/.old_lace]
                             [/.olive]
                             [/.olive_drab]
                             [/.orange]
                             [/.orange_red]
                             [/.orchid]]
                            )))
            p-y (list (,, (template.with [<name>]
                            [(description <name>)]

                            [[/.pale_goldenrod]
                             [/.pale_green]
                             [/.pale_turquoise]
                             [/.pale_violet_red]
                             [/.papaya_whip]
                             [/.peach_puff]
                             [/.peru]
                             [/.pink]
                             [/.plum]
                             [/.powder_blue]
                             [/.purple]
                             [/.rebecca_purple]
                             [/.red]
                             [/.rosy_brown]
                             [/.royal_blue]
                             [/.saddle_brown]
                             [/.salmon]
                             [/.sandy_brown]
                             [/.sea_green]
                             [/.sea_shell]
                             [/.sienna]
                             [/.silver]
                             [/.sky_blue]
                             [/.slate_blue]
                             [/.slate_gray]
                             [/.snow]
                             [/.spring_green]
                             [/.steel_blue]
                             [/.tan]
                             [/.teal]
                             [/.thistle]
                             [/.tomato]
                             [/.turquoise]
                             [/.violet]
                             [/.wheat]
                             [/.white]
                             [/.white_smoke]
                             [/.yellow]
                             [/.yellow_green]]
                            )))]
        (list.partial ($.module /._
                                "")

                      (all list:composite
                           a-c
                           d-k
                           l-o
                           p-y
                           )))))
