canvas::gradient(3tk)

πŸ“¦
version 0.9 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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 canvas pathName. 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 ⭐

  • -direction direction β€” this one says which way the gradient goes. If you don't specify it, the system defaults to x, 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. πŸŒ€
  • -color1 color β€” the starting color of the gradient. If you don't say anything, it defaults to red. ❀️
  • -color2 color β€” the ending color of the gradient. If you don't say anything, it defaults to green. πŸ’š
  • -type type β€” 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



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