ObjectProfile / Roassal3

The Roassal Visualization Engine
MIT License
95 stars 52 forks source link

Polymorphic color palettes #546

Open olekscode opened 1 year ago

olekscode commented 1 year ago

In Roassal3, I would like to have a color palette API that could be used like this:

"Choose a color palette"
palette := RSColorPaletteA new.
palette := RSColorPaletteB new.
palette := RSColorPaletteC new.

"Use named colors"
palette red.
palette green.
palette yellow.
palette blue.
palette darkRed.
palette lightBlue.

The idea is the same as in Color red. Color yellow, etc. Why?

Because in most applications, when we chart, we want to say "give me a red line and a blue line". And then we don't need those colors to be true red (i.e., Color red) or true blue (i.e., Color blue). We want them to be red and blue that are aestethically beutiful and match each other well.

This can be decided by the palette class.

Also, users want to say "red" and "blue", not "third color from palette diverse085"

olekscode commented 1 year ago

We could take some inspiration from this package: https://github.com/DuneSt/MaterialColors

It subclasses Color to follow Materiel Design color recommendations https://m2.material.io/design/color/the-color-system.html

akevalion commented 1 year ago

This issue is related outside of Roassal, probably this is a new project.

These sets of colors can be used by not only roassal, also spec or https://github.com/plantec/Toplo

Roassal contains already some color palettes in Roassal3-Colors with classes like RSColorPalette

palette := RSColorPalette sequential blues9.
image
akevalion commented 8 months ago

moved to pharo-graphics/Roassal