13 Miscellaneous

▼ |  | Pict: Functional Pictures

1 | Pict Datatype
2 | Basic Pict Constructors
3 | Pict Combiners
4 | Pict Drawing Adjusters
5 | Bounding Box Adjusters
6 | Pict Finders
7 | More Pict Constructors
8 | Animation Helpers
9 | Color Helpers
10 | Shadows
11 | Conditional Combinations
12 | Tree Layout
13 | Miscellaneous
14 | Rendering
15 | Conversion to Picts

On this page:

hyperlinkize
scale-color
color-series

top contents ← prev up next →

### 13`` Miscellaneous🔗ℹ

> procedure (hyperlinkize pict) → pict?
> pict : pict-convertible?

Adds an underline and blue color. The pict’s height and descent are extended.

Example:

> > (hyperlinkize (text "Help me I'm trapped in this documentation"
> null 15))

> procedure (scale-color factor color) → (is-a?/c color%)
> factor : real?
> color : (or/c string (is-a?/c color%))

Scales a color, making it brighter or darker. If the factor is less than 1, the color is darkened by multiplying the RGB components by the factor. If the factor is greater than 1, the color is lightened by dividing the gap between the RGB components and 255 by the factor.

Examples:

> > (disk 30 #:color "royalblue")
> > (disk 30 #:color (scale-color 0.5 "royalblue"))
> > (disk 30 #:color (scale-color 1.5 "royalblue"))

> > procedure
> > (color-series |  | dc |  |  |  |
> > |  | max-step |  |  |  |
> > |  | step-delta |  |  |  |
> > |  | start |  |  |  |
> > |  | end |  |  |  |
> > |  | proc |  |  |  |
> > |  | set-pen? |  |  |  |
> > |  | set-brush?) |  | → |  | void?
> dc : (is-a?/c dc<%>)
> max-step : exact-nonnegative-integer?
> step-delta : (and/c exact? positive?)
> start : (or/c string? (is-a?/c color%))
> end : (or/c string? (is-a?/c color%))
> proc : (exact? . -> . any)
> set-pen? : any/c
> set-brush? : any/c

Calls a proc multiple times, gradually changing the pen and/or brush color for each call. For the first call, the current pen and/or brush color matches start; for the last call, it matches end; and for intermediate calls, the color is an intermediate color.

The max-step and step-delta arguments should be exact numbers; the procedure is called with each number from 0 to max-step inclusive using a step-delta increment.

top contents ← prev up next →