Colors like
SystemHighlightText, SystemWindowText, SystemHighlight, SystemButtonFace, ...
can be used for setting some widgets' colors
frame .f -background SystemButtonFace
but they cannot be used for filling a tk-photo image
image create photo IMAGE
IMAGE put SystemButtonFace -to 0 0 40 40
--> can't parse color "SystemButtonFace"
Is this a bug ?
Is there a workaround for filling IMAGE with these colors ?
Colors like
SystemHighlightText, SystemWindowText, SystemHighlight, SystemButtonFace, ...
can be used for setting some widgets' colors
frame .f -background SystemButtonFace
but they cannot be used for filling a tk-photo image
image create photo IMAGE
IMAGE put SystemButtonFace -to 0 0 40 40
--> can't parse color "SystemButtonFace"
Is this a bug ?
Is there a workaround for filling IMAGE with these colors ?
Hi
Try
frame .f -background SystemButtonFace
image create photo IMAGE
IMAGE put [.f cget -background] -to 0 0 40 40
regards
Manfred
Am 20.08.23 um 15:31 schrieb aldo.w....@gmail.com:
Colors like
SystemHighlightText, SystemWindowText, SystemHighlight, SystemButtonFace, ...
can be used for setting some widgets' colors
frame .f -background SystemButtonFace
but they cannot be used for filling a tk-photo image
image create photo IMAGE
IMAGE put SystemButtonFace -to 0 0 40 40
can't parse color "SystemButtonFace"
Is this a bug ?
Is there a workaround for filling IMAGE with these colors ?
Colors like
SystemHighlightText, SystemWindowText, SystemHighlight, SystemButtonFace, ...
can be used for setting some widgets' colors
frame .f -background SystemButtonFace
but they cannot be used for filling a tk-photo image
image create photo IMAGE
IMAGE put SystemButtonFace -to 0 0 40 40
--> can't parse color "SystemButtonFace"
Is this a bug ?
Is there a workaround for filling IMAGE with these colors ?
On 8/20/2023 9:31 AM, aldo.w....@gmail.com wrote:
Colors like
SystemHighlightText, SystemWindowText, SystemHighlight, SystemButtonFace, ...
can be used for setting some widgets' colors
frame .f -background SystemButtonFace
but they cannot be used for filling a tk-photo image
image create photo IMAGE
IMAGE put SystemButtonFace -to 0 0 40 40
can't parse color "SystemButtonFace"
Is this a bug ?I think those are symbolic names that are platform dependent and that
Is there a workaround for filling IMAGE with these colors ?
are only recognized by built-in widgets.
In any case, I use something like this:
proc get_color_code {c} {
lassign [winfo rgb . $c] r g b
set r [expr {$r % 256}]
set g [expr {$g % 256}]
set b [expr {$b % 256}]
format "\#%02x%02x%02x" $r $g $b
}
% get_color_code SystemHighlightOK this works,
#0078d7
% get_color_code SystemButtonFace
#f0f0f0
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 307 |
Nodes: | 16 (2 / 14) |
Uptime: | 62:26:48 |
Calls: | 6,915 |
Files: | 12,379 |
Messages: | 5,431,461 |