File: canvas_gradient.man

package info (click to toggle)
tklib 0.6%2B20190108-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 15,008 kB
  • sloc: tcl: 75,757; sh: 5,789; ansic: 792; pascal: 359; makefile: 70; sed: 53; exp: 21
file content (113 lines) | stat: -rw-r--r-- 3,328 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
[comment {-*- tcl -*- doctools manpage}]
[comment {- -- ---- -------- ---------------- -------------------------------}]
[manpage_begin canvas::gradient n 0.2]
[keywords background]
[keywords canvas]
[keywords {color gradient}]
[keywords gradients]
[keywords image]
[keywords {widget background}]
[moddesc   {Variations on a canvas}]
[copyright {2013 Jarek Lewandowski, MaxJarek}]
[copyright {Origin http://wiki.tcl.tk/6100}]
[copyright {Origin http://wiki.tcl.tk/37242}]
[copyright {Origin http://wiki.tcl.tk/9079}]
[titledesc {Canvas with a gradient background}]
[require Tcl 8.5]
[require Tk 8.5]
[require canvas::gradient [opt 0.2]]
[description]

This package provides a command to set background gradients on canvases.

[para] [emph NOTE!] This package reserves the canvas tag
[const {canvas::gradient}] for its use.

[comment {- -- ---- -------- ---------------- -------------------------------}]
[section API]

[list_begin definitions]
[call [cmd ::canvas::gradient] [arg pathName] [opt options]...]

Creates a background gradient on the canvas [arg pathName].
An existing gradient is replaced by the new definition.

[para] The set of available options is decribed below, in
section [sectref Options].

[list_end]

[comment {- -- ---- -------- ---------------- -------------------------------}]
[subsection Options]

[list_begin options]
[opt_def -direction [arg direction]]

The value for this option specifies the [arg direction] of the gradient.
If not specified the system defaults to [const x], a horizontal gradient.
The package supports five directions:

[list_begin definitions]
[def [const x]]
  for a horizontal gradient (default).
  Color changes along the x-axis,
  with the start color at the left.

[def [const y]]
  for a vertical gradient.
  Color changes along the y-axis,
  with the start color at the top.

[def [const d1]]
  for a diagonal gradient from left+top to bottom+right.
  Color changes along the diagonal.
  with the start color at left+top.

[def [const d2]]
  for a diagonal gradient from left+bottom to top+right.
  Color changes along the diagonal.
  with the start color at left+bottom.

[def [const r]]
  for a radial gradient around the center of the viewport
  Color changes from the center outward,
  with the start color at the center.

[list_end]

[opt_def -color1 [arg color]]

The value for this option specifies the starting color of the gradient.
If not specified it defaults to [const red].

[opt_def -color2 [arg color]]

The value for this option specifies the ending color of the gradient.
If not specified it defaults to [const green].

[opt_def -type [arg type]]

The value for this option specifies how the gradient is calculated.
The package currently supports on ly one method, which is the
default, naturally:

[list_begin definitions]
[def [const linear]]
for linear interpolation between the start and end colors (default).
[list_end]
[list_end]

[comment {- -- ---- -------- ---------------- -------------------------------}]
[section Example]

[example {
	package require canvas::gradient
	canvas .c
	canvas::gradient .c -direction x -color1 yellow -color2 blue
	pack .c -fill both -expand 1
}]

[comment {- -- ---- -------- ---------------- -------------------------------}]
[vset CATEGORY canvas]
[include ../../support/devel/doc/feedback.inc]
[manpage_end]