mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2024-12-29 16:29:40 +00:00
Docs tweaks for colors.scad, constants.scad
This commit is contained in:
parent
afadd9301a
commit
fb23e0267a
2 changed files with 24 additions and 11 deletions
33
color.scad
33
color.scad
|
@ -16,17 +16,21 @@ use <builtins.scad>
|
|||
// Section: Coloring Objects
|
||||
|
||||
// Module: recolor()
|
||||
// Synopsis: Sets the color for attachable children and all their descendants.
|
||||
// Synopsis: Sets the color for attachable children and their descendants.
|
||||
// Topics: Attachments
|
||||
// See Also: color_this(), hsl(), hsv()
|
||||
// Usage:
|
||||
// recolor([c]) CHILDREN;
|
||||
// Description:
|
||||
// Sets the color for attachable children and all their descendants. This only works with attachables and you cannot
|
||||
// have any color() modules above it in any parents, only other recolor() or color_this() modules.
|
||||
// This works by setting the special `$color` variable, which attachable objects make use of to set the color.
|
||||
// Sets the color for attachable children and their descendants, down until another {{recolor()}}
|
||||
// or {{color_this()}}. This only works with attachables and you cannot have any color() modules
|
||||
// above it in any parents, only other {{recolor()}} or {{color_this()}} modules. This works by
|
||||
// setting the special `$color` variable, which attachable objects make use of to set the color.
|
||||
// Arguments:
|
||||
// c = Color name or RGBA vector. Default: The default color in your color scheme.
|
||||
// Side Effects:
|
||||
// Changes the value of `$color`.
|
||||
// Sets the color of child attachments.
|
||||
// Example:
|
||||
// cuboid([10,10,5])
|
||||
// recolor("green")attach(TOP,BOT) cuboid([9,9,4.5])
|
||||
|
@ -56,6 +60,9 @@ module recolor(c="default")
|
|||
// which attachable objects make use of to set the color.
|
||||
// Arguments:
|
||||
// c = Color name or RGBA vector. Default: the default color in your color scheme
|
||||
// Side Effects:
|
||||
// Changes the value of `$color` and `$save_color`.
|
||||
// Sets the color of child attachments.
|
||||
// Example:
|
||||
// cuboid([10,10,5])
|
||||
// color_this("green")attach(TOP,BOT) cuboid([9,9,4.5])
|
||||
|
@ -123,14 +130,17 @@ module rainbow(list, stride=1, maxhues, shuffle=false, seed)
|
|||
// hsl(h,[s],[l],[a]) CHILDREN;
|
||||
// rgb = hsl(h,[s],[l],[a]);
|
||||
// Description:
|
||||
// When called as a function, returns the [R,G,B] color for the given hue `h`, saturation `s`, and lightness `l` from the HSL colorspace. If you supply
|
||||
// the `a` value then you'll get a length 4 list [R,G,B,A].
|
||||
// When called as a module, sets the color using the color() module to the given hue `h`, saturation `s`, and lightness `l` from the HSL colorspace.
|
||||
// When called as a function, returns the `[R,G,B]` color for the given hue `h`, saturation `s`, and
|
||||
// lightness `l` from the HSL colorspace. If you supply the `a` value then you'll get a length 4
|
||||
// list `[R,G,B,A]`. When called as a module, sets the color using the color() module to the given
|
||||
// hue `h`, saturation `s`, and lightness `l` from the HSL colorspace.
|
||||
// Arguments:
|
||||
// h = The hue, given as a value between 0 and 360. 0=red, 60=yellow, 120=green, 180=cyan, 240=blue, 300=magenta.
|
||||
// s = The saturation, given as a value between 0 and 1. 0 = grayscale, 1 = vivid colors. Default: 1
|
||||
// l = The lightness, between 0 and 1. 0 = black, 0.5 = bright colors, 1 = white. Default: 0.5
|
||||
// a = Specifies the alpha channel as a value between 0 and 1. 0 = fully transparent, 1=opaque. Default: 1
|
||||
// Side Effects:
|
||||
// When called as a module, sets the color of all children.
|
||||
// Example:
|
||||
// hsl(h=120,s=1,l=0.5) sphere(d=60);
|
||||
// Example:
|
||||
|
@ -161,14 +171,17 @@ module hsl(h,s=1,l=0.5,a=1)
|
|||
// hsv(h,[s],[v],[a]) CHILDREN;
|
||||
// rgb = hsv(h,[s],[v],[a]);
|
||||
// Description:
|
||||
// When called as a function, returns the [R,G,B] color for the given hue `h`, saturation `s`, and value `v` from the HSV colorspace. If you supply
|
||||
// the `a` value then you'll get a length 4 list [R,G,B,A].
|
||||
// When called as a module, sets the color using the color() module to the given hue `h`, saturation `s`, and value `v` from the HSV colorspace.
|
||||
// When called as a function, returns the `[R,G,B]` color for the given hue `h`, saturation `s`, and
|
||||
// value `v` from the HSV colorspace. If you supply the `a` value then you'll get a length 4 list
|
||||
// `[R,G,B,A]`. When called as a module, sets the color using the color() module to the given hue
|
||||
// `h`, saturation `s`, and value `v` from the HSV colorspace.
|
||||
// Arguments:
|
||||
// h = The hue, given as a value between 0 and 360. 0=red, 60=yellow, 120=green, 180=cyan, 240=blue, 300=magenta.
|
||||
// s = The saturation, given as a value between 0 and 1. 0 = grayscale, 1 = vivid colors. Default: 1
|
||||
// v = The value, between 0 and 1. 0 = darkest black, 1 = bright. Default: 1
|
||||
// a = Specifies the alpha channel as a value between 0 and 1. 0 = fully transparent, 1=opaque. Default: 1
|
||||
// Side Effects:
|
||||
// When called as a module, sets the color of all children.
|
||||
// Example:
|
||||
// hsv(h=120,s=1,v=1) sphere(d=60);
|
||||
// Example:
|
||||
|
|
|
@ -171,7 +171,7 @@ FWD = FRONT;
|
|||
FORWARD = FRONT;
|
||||
|
||||
// Constant: BACK
|
||||
// Synopsis: The back-wards (Y+) direction vector constant `[0,1,0]`.
|
||||
// Synopsis: The backwards (Y+) direction vector constant `[0,1,0]`.
|
||||
// Topics: Constants, Vectors
|
||||
// See Also: LEFT, RIGHT, FRONT, UP, DOWN, CENTER
|
||||
// Description: Vector pointing back. [0,1,0]
|
||||
|
|
Loading…
Reference in a new issue