brighten

$fill brighten fill (factor)
changes fill color by factor and not constraint
$fill brighten outline (factor)
changes colors of contained lines by factor and not constraint

obj method fill brighten {what factor} {
  switch -exact -- $what {
    outline {
      if {![$self constraint linecolor]} then {
        $self lines brighten $what $factor
      }
    }
    fill {
      if {
        ![$self constraint fillcolor] &&
        [$self cget -fill] ni {{} transparent}
      } then {
        set color [::brighten [$self cget -fill] $factor]
        $self configure -fill $color
      }
    }
  }
}

© Wolf-Dieter Busch | Home | Sitemap | Urheber | A-Z