Skip to content

Color styling problem #253

@njskalski

Description

@njskalski

Hi,

this is going to be a little controversial: I spend a lot of time while working with Cursive in a very non-effective way trying to get desired coloring of views. Since the styling (like applying effects, using different colors from Palette) is usually determined by the code of View::draw(...) method, I am forced to either create wrappers that modify a theme to each view in separate or fork the entire view and manually modify the drawing method. That obviously increases cost of development and maintenance, especially with complex third party views.

In views I write, I decided to move away from predefined palette, and created something like a "style tree", where I just override colors with html color codes defined in JSON. If other (default, third party etc) views used similar technique, I would be able to achieve required styling very fast, in a way a little similar to CSS.

Would that be something you could consider for Cursive? If you are open to discussion I can make a design draft. I am thinking about something like this: https://github.com/njskalski/sly-editor/blob/master/src/default_settings.rs (theme part) but more streamlined. Like "cascading, json defined themes", that could be deserialized into objects via serde_json, so one can either configure in-code or via json.

I we'd agree on some format, I could help you to update the views, and fork and update some third party views, even help with maintaining.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions