Hi Everybody, I have a WkTableWidgetView with rows that I want to color some cells based upon the value of a column in a row. I can do this easily. I catch a #cellValueRequested and send the widget #backgroundColor: Color yellow. This give a bright yellow color. I would like to use a milder yellow. Color lookupColor: 'LemonChiffon' would be fine but when it paints it is gray. Now Color yellow and Color lookupColor: 'LemonChiffon' both result is an instance of Color. Color yellow is Color(16rFFFF,16rFFFF,16r0), Color lookupColor: 'LemonChiffon' is Color(16rFFFF,16rFAFA,16rCDCD). Where does the gray come from? It seems #cellValueRequested #backgroundColor: expects an instance of Color, so what is wrong here? I use 'LemonChiffon' as a background color for a AbtMultiLineEditView field and it paints as expected. Lou You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
Administrator
|
On Tuesday, June 9, 2015 at 3:19:29 PM UTC-7, Louis LaBrunda wrote:
--
Lou, I followed this a little way, but not to a conclusion. After the #cellValueRequested call, it arrives in EwTableCell>>#initializeFrom:. I see code in there talking of a colour palette (anEwCellValueCallbackData column widget colorMap palette) and #nearestPixelValue:. There are Direct Palettes and Indexed Palettes, so you need to ensure your table uses a Direct Palette, otherwise the colours will get mapped to the subset available in the Indexed Palette.
I hacked on AbtContainerColorTest in AbtContainerExamplesApp. You can file in these changes and play with it more. Let us know what you find!
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
Hi Richard,
-- Thanks for the reply and sorry it took me so long to get back to this. I followed the code a bit and it seems the widget being colored only takes the base 16 colors. I don't know why that choice was made but that is what it seems. It may have a very old history and never been updated. It doesn't look like it will be very easy to change so I will just have to live with it unless Instantiations has plans to change it or I'm missing something. Lou On Tuesday, June 9, 2015 at 8:13:54 PM UTC-4, Richard Sargent wrote:
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
Administrator
|
On Tuesday, June 16, 2015 at 9:04:15 AM UTC-7, Louis LaBrunda wrote:
--
It defaults to 16, but it is not limited to 16. Unfortunately, it appears you cannot use the Direct Color palette with parts, only with images. I suggest you use the VA documentation to search the Programmer's Reference for "palette". There is some information in there. Unfortunately, it is all at the Common Graphics level. Also, look at the senders of CgDrawable>>#setPalette:. One of the most interesting will be StsSyntaxColorControlPanel>>#initWindow, which ultimately uses StsPowerTools class>>#colorArray16. This last method answers a 49 element colour palette.
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
On Tuesday, June 16, 2015 at 1:34:30 PM UTC-4, Richard Sargent wrote:
I thought I found some code that converted the color to and index between 0 & 15 or 1 & 16 (I forget which).
Changing the palette may work, I will have to take a look and see if it is worth the effort. Thanks again, Lou You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
Free forum by Nabble | Edit this page |