diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/documentation/lux/data.lux | 98 | ||||
-rw-r--r-- | stdlib/source/documentation/lux/data/color.lux | 112 | ||||
-rw-r--r-- | stdlib/source/documentation/lux/data/color/named.lux | 10 |
3 files changed, 101 insertions, 119 deletions
diff --git a/stdlib/source/documentation/lux/data.lux b/stdlib/source/documentation/lux/data.lux index 93ecf8753..9f0f9d036 100644 --- a/stdlib/source/documentation/lux/data.lux +++ b/stdlib/source/documentation/lux/data.lux @@ -9,20 +9,114 @@ ["[1][0]" binary] ["[1][0]" bit] ["[1][0]" collection] - ["[1][0]" color] + ["[1][0]" color + ["[1]/[0]" named]] ["[1][0]" format] ["[1][0]" identity] ["[1][0]" product] ["[1][0]" sum] ["[1][0]" text]]) +... (def palette_documentation +... (syntax (_ [[_ name] <code>.symbol]) +... (in (list (code.text (format "A " (text.replaced "_" "-" name) " palette.")))))) + +... (`` (def .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))) + +... (,, (with_template [<name>] +... [(`` ($.definition <name> +... (format "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 +... ) +... )))) + (def .public documentation (List $.Documentation) (list.together (list /binary.documentation /bit.documentation /collection.documentation - /color.documentation + /color/named.documentation /format.documentation /identity.documentation /product.documentation diff --git a/stdlib/source/documentation/lux/data/color.lux b/stdlib/source/documentation/lux/data/color.lux deleted file mode 100644 index 768fb1ffb..000000000 --- a/stdlib/source/documentation/lux/data/color.lux +++ /dev/null @@ -1,112 +0,0 @@ -(.require - [library - [lux (.except) - ["$" documentation] - [data - ["[0]" text (.only \n) - ["%" \\format (.only format)]] - [collection - ["[0]" list (.use "[1]#[0]" monoid)]]] - [meta - ["[0]" code (.only) - ["<[1]>" \\parser]] - [macro - [syntax (.only syntax)] - ["[0]" template]]]]] - [\\library - ["[0]" /]] - ["[0]" / - ["[1][0]" named]]) - -(def palette_documentation - (syntax (_ [[_ name] <code>.symbol]) - (in (list (code.text (format "A " (text.replaced "_" "-" name) " palette.")))))) - -(`` (def .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))) - - (,, (with_template [<name>] - [(`` ($.definition <name> - (format "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 - ) - )))) diff --git a/stdlib/source/documentation/lux/data/color/named.lux b/stdlib/source/documentation/lux/data/color/named.lux index 49eb0847d..fe90ee829 100644 --- a/stdlib/source/documentation/lux/data/color/named.lux +++ b/stdlib/source/documentation/lux/data/color/named.lux @@ -12,17 +12,17 @@ ["[0]" nat (.use "hex#[0]" hex)]]]]] [\\library ["[0]" / (.only) - ["/[1]" // (.only) + [// ["[0]" rgb]]]]) (def description (template (_ <name>) [($.definition <name> - (let [[red green blue] (//.rgb <name>) + (let [[red green blue] <name> [_ name] (symbol <name>)] - (format "R:" (hex#encoded (rgb.number red)) - " G:" (hex#encoded (rgb.number green)) - " B:" (hex#encoded (rgb.number blue)) + (format "R:" (hex#encoded red) + " G:" (hex#encoded green) + " B:" (hex#encoded blue) " | " (text.replaced "_" " " name))))])) (`` (def .public documentation |