Bwidget Source Code
View Ticket
Not logged in
Ticket UUID: 3f82f0429d5e18adc1a52b5e898ca905a6804b2b
Title: Color picker: 11 user colors, why not 12 ?
Type: Bug Version: current
Submitter: oehhar Created on: 2025-02-28 13:07:56
Subsystem: bwidget 1.x Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2025-08-05 13:31:30
Resolution: None Closed By: nobody
    Closed on:
Description:
And i notice there are only 11 userColors initialised for some reason. I had been duplicating this in my program until today, but i find that If i tell bwidgets to use 12 User Colors, it works perfectly.
User Comments: anonymous (claiming to be TWu) added on 2025-08-05 13:31:30:
Hello Harald,

in Addition to my last comment:
The 12. color was not defined because the place for it is used in the popup menu for the palette symbol/open dialog-button.
But in dialog mode we can use the proposed 12. defined color (or more lines too).
Therefore it has to be defined, as proposed.
To get *NO* new line in popup-mode, a second change is needed, just after combine the base- and user-colors together -> line 110:
    set colors [concat $_baseColors $_userColors]
++++
    # remove last user color to get space for palette button to open dialog
    set colors [lreplace $colors end end]
====
Then the rest goes right from -> line 111:
    foreach color $colors {

This solution is fine for more lines of user colors too.
That's all! Please do the change and commit it.

Thank You and best greetings
Thomas W.

anonymous (claiming to be TWu) added on 2025-03-31 14:36:56:
Hello together,
the solution is simple and in colors.tcl, line 20:
Please add the twelfth _userColors definition "\#ffffff".
Reason, as long as the inner foreach loop runs only over the defined values, it breaks after the eleventh defined color (line 187 ff.).
Best greetings and success
Thomas W.

oehhar added on 2025-02-28 13:12:36:
Hi Steven,
thank you for the proposal.
I think, there are 11 user colors for the reason, that all colors may be shown on the small color palette.

The colors are aranged in 6 columns on both widgets and 5 rows.
In the small color picker, the lower-right corner has an icon to open the big color picker.

That might be the reason, why there is one user color less?

It might be also ok to show the last user color only in the large display.

Thanks for any patches.

Take care,
Harald

Attachments: