canvas::gradient(3tk)
π canvas::gradient β bestie edition π
okay so this is the manual page for canvas::gradient, living in the canvas corner of tklib (it's a section 3tk page, iykyk). It's literally "Variations on a canvas" and it's about giving your canvas a gradient background. slay. π¦
β¨ NAME β¨
canvas::gradient β Canvas with a gradient background π
π SYNOPSIS π
package require Tcl 8.5
package require Tk 8.5
package require canvas::gradient ?0.2?
::canvas::gradient pathName ?options?...
like, Tcl 8.5 minimum, Tk 8.5 minimum, and the package itself is version 0.2 (but you don't have to ask for a version, the ?0.2? part is optional π
).
πΈ DESCRIPTION πΈ
This package hands you a command that sets background gradients on canvases. that's the whole job. it does it gorgeously. β¨
NOTE! This package reserves the canvas tag canvas::gradient for its own use. bestie. do not touch it. it's hers. π
π API π
::canvas::gradient pathName ?options?...β Creates a background gradient on the canvaspathName. and listen: if a gradient already exists there, the new definition replaces it. out with the old, in with the new, no cap. π
The set of available options is described below, in section Options.
β OPTIONS β
-directiondirection β this one says which way the gradient goes. If you don't specify it, the system defaults tox, a horizontal gradient. The package supports five directions, and they are:xβ a horizontal gradient (default). Color changes along the x-axis, with the start color at the left. β¬ οΈβ‘οΈyβ a vertical gradient. Color changes along the y-axis, with the start color at the top. β¬οΈβ¬οΈd1β a diagonal gradient from left+top to bottom+right. Color changes along the diagonal, with the start color at left+top. βοΈd2β a diagonal gradient from left+bottom to top+right. Color changes along the diagonal, with the start color at left+bottom. βοΈrβ a radial gradient around the center of the viewport. Color changes from the center outward, with the start color at the center. π
-color1color β the starting color of the gradient. If you don't say anything, it defaults tored. β€οΈ-color2color β the ending color of the gradient. If you don't say anything, it defaults togreen. π-typetype β how the gradient gets calculated. The package currently supports only one method, which is the default, naturally:linearβ linear interpolation between the start and end colors (default). π
π§ EXAMPLE π§
like, here's the whole vibe:
package require canvas::gradient
canvas .c
canvas::gradient .c -direction x -color1 yellow -color2 blue
pack .c -fill both -expand 1
yellow to blue, horizontal, packed and filling. iconic. ate. π₯
π BUGS, IDEAS, FEEDBACK π
This document, and the package it describes, will undoubtedly contain bugs and other problems. π (not me being honest in the manual but ok, growth.)
Please report such in the category canvas of the Tklib Trackers at http://core.tcl.tk/tklib/reportlist.
Please also report any ideas for enhancements you may have for either the package and/or the documentation. bestie, they want your thoughts. π«Ά
π KEYWORDS π
background, canvas, color gradient, gradients, image, widget background
π COPYRIGHT π
- Copyright (c) 2013 Jarek Lewandowski, MaxJarek
- Copyright (c) Origin
http://wiki.tcl.tk/6100 - Copyright (c) Origin
http://wiki.tcl.tk/37242 - Copyright (c) Origin
http://wiki.tcl.tk/9079
okay that's the whole page, no skips, no crumbs left behind. this came to you from tklib, version 0.2, and it's the canvas::gradient(3tk) manual page. go forth and make pretty backgrounds. πβ¨ππ¦πΈπ
π«Ά
π¦ where this page comes from
- debian trixie: tklib 0.9-1
- ubuntu questing: tklib 0.9-1
- ubuntu resolute: tklib 0.9-1build1
- ubuntu stonking: tklib 0.9-1build1
- Copyright (c) 2013 Jarek Lewandowski, MaxJarek
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms