Hi,
The ColorPalette in Roassal2 is quite cool, but we should refactor the code to not rely on strings.
An example: |n elements view| n := RTBucketColor numberOfColors: 5 command: #asInteger scope: ($a to: $z). n colorScheme: 'Blues'. elements := (RTBox new size: 20; color: n) elementsOn: ($a to: $z). view := RTView new. view addAll: elements. RTGridLayout on: view elements. view open.
'Blues' is actually an identifier that is looked up in all the rawPalette keys returned by the subclasses of ColorPalette.
This is not nice. We should have for each palette a method with the same name, and the colorScheme: should work with an object like: n colorScheme: CPSequential blues
Do we agree on this?
Doru
I perfectly agree. I think Pablo did this because of an algorithm he found and copied it. Untangling the whole thing is relatively straight forward. The starting point is to look at the implementation of #rawPalette in the subclasses of ColorPalette.
I will put this on our todo list.
Alexandre