canvas::gradient(n)

πŸ“¦ version 0.7, in alpine 3.24

πŸ¦‹ canvas::gradient(n) πŸ¦‹

okay bestie, welcome to the canvas::gradient(n) page β€” it's from the Variations on a canvas manual, and it's literally about making canvas backgrounds look like a whole vibe. slay.


πŸ’… NAME πŸ’…

canvas::gradient β€” Canvas with a gradient background. iconic.


✨ SYNOPSIS ✨

package require Tcl  8.5

package require Tk  8.5

package require canvas::gradient  ?0.2?

::canvas::gradient pathName ?options?...

πŸ¦‹ DESCRIPTION πŸ¦‹

This package gives you a command to set background gradients on canvases. obsessed.

NOTE! This package reserves the canvas tag canvas::gradient for its use. so don't touch that tag, bestie.

πŸ’– API πŸ’–

  • ::canvas::gradient pathName ?options?... β€” creates a background gradient on the canvas pathName. If there's already a gradient, the new definition replaces it. The available options are in OPTIONS below. main character command energy.

🎨 OPTIONS 🎨

  • -direction direction β€” sets the direction of the gradient. If you don't specify it, the system defaults to x, a horizontal gradient. The package supports five directions:
    • x β€” horizontal gradient (default). Color changes along the x-axis, with the start color at the left. left-to-right slay.
    • y β€” vertical gradient. Color changes along the y-axis, with the start color at the top.
    • d1 β€” diagonal gradient from left+top to bottom+right. Color changes along the diagonal, with the start color at left+top.
    • d2 β€” diagonal gradient from left+bottom to top+right. Color changes along the diagonal, with the start color at left+bottom.
    • r β€” radial gradient around the center of the viewport. Color changes from the center outward, with the start color at the center.
  • -color1 color β€” starting color of the gradient. Defaults to red if you don't specify it.
  • -color2 color β€” ending color of the gradient. Defaults to green if you don't specify it.
  • -type type β€” how the gradient is calculated. Right now the package supports only one method, which is the default, naturally:
    • linear β€” linear interpolation between the start and end colors (default).

🌈 EXAMPLE 🌈

package require canvas::gradient
canvas .c
canvas::gradient .c -direction x -color1 yellow -color2 blue
pack .c -fill both -expand 1

😭 BUGS, IDEAS, FEEDBACK 😭

This document and the package it describes will undoubtedly contain bugs and other problems. not me saying that, it's literally in the original. Please report such in the category canvas of the Tklib Trackers: http://core.tcl.tk/tklib/reportlist. Please also report any ideas for enhancements you may have for either package and/or documentation. we love feedback bestie.


πŸ”‘ KEYWORDS πŸ”‘

background, canvas, color gradient, gradients, image, widget background. iykyk.


okay that's the whole page β€” from tklib, version 0.2, for canvas::gradient(n), with no date in the footer, bestie. πŸ’–

πŸ“¦ where this page comes from