Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
update ideas for lib feature
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-moen committed Sep 23, 2018
1 parent e35592c commit d32ac89
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions ideas/language/Lib
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ of primitives for constructing shapes. The new `lib` feature allows these
primitives to be organized into a hierarchical module namespace, with modules
that are only loaded into memory on first reference.

Suppose that `web_colour` is a standard library module that contains all of
the HTML5 colour names. To define it, create `lib/curv/web_colour.curv`,
then run `make install`. Then here is how you can use it:
Currently defined library modules:
* lib.web_colour : defines all of the standard CSS colour names

Here is how you can use lib.web_colour:

lib.web_colour.peach_puff

Expand All @@ -21,13 +22,11 @@ then run `make install`. Then here is how you can use it:
in
wc.peach_puff

The source code for library modules is found in lib/curv, and these files
are installed in /usr/local/lib/curv by `make install`.

Here are some ideas for new library modules.

web_colour
Defines all of the HTML5/CSS colour names.
Defines the function rgb(r,g,b): arguments are in the range 0 to 255.
The colour names are defined using the `rgb` function.
For example: `peach_puff = rgb(55,218,185);`
blend
A richer set of blending primitives, pulled from multiple sources.
@gsohler is working on a pull request to add the Mercury blend primitives
Expand All @@ -45,6 +44,7 @@ noise
Resources:
* http://github.com/ashima/webgl-noise
* https://gist.github.com/patriciogonzalezvivo/670c22f3966e662d2f83
* https://www.shadertoy.com/results?query=tag%3Dnoise
fractal
Primitives for making fractals, perhaps based on Mandelbulber
and the example code in Fragmentarium.
Expand All @@ -69,5 +69,5 @@ repetition & space folding

Additional resources:
Look at the examples in Fragmentarium, or perhaps shadertoy.com, and recreate
interesting examples using high level library primitives, inventing new
interesting models using high level library primitives, inventing new
primitives as necessary.

0 comments on commit d32ac89

Please sign in to comment.