Is there a more clever way to color fields than display rules?

I have a table with with “Day-Categories” which is connected to a “Days”-Table. every individual record has a color assigned to it. I’ve added a text field for the hex value. atm this is more or less just a reminder.
I’m looking for a way to use this data in a clever way to give fields background colors. To be more precise, I want to show the Day-Category on a component and then use the color information in the table to change the backgroundcolor of the field. I want to avoid writing a million display rules in a million different places.
See the attached screenshot as an example. this all display rules tho…

Thats the Daytype Table

Somebody will still need to define the hex value for each date in the year. … right? instead why not just have a colour to represent each day of the week?

not really. the days have specific types/categorys. the category is what defines the color. thats why I have a “Type”-table and I connect days to that. eg. a day with the category “Offday” has the color #38b4fd.

I’m sure we can make a plugin for this.

Essentially, the row can be a color based on the hex color from another column. You can then simply hide the column with CSS.

WIll update this here if its possible and when its done.

3 Likes

ideally it’s not the full row. but only one column. maybe via an assigned css-class

This would be great, looking for this solution for a long time already. It would be great in connection with the display rule so you can add CSS-classes based on a value in a field.

Like this, but replace CSS classes with a field mentioning the CSS-class.

1 Like

@moe
This would a awesome addition to PDF Pages 2.0 if JS is ever allowed, as well. Would love this!
~Adam

Just now saw this but we published this new plugin as a full row feature based on hard coded colors. We’ll make an additional version that will apply a CSS class instead.

1 Like

The new plugin is already awesome. But I want to explain further what I‘d really like to see. I only want to color that one or two columns in the table. So my idea was to assign a css class like „color-me“ to the columns and the plugin then would assign the hex value from the hidden color column.
I could also take good use of that in lists, since I hide these tables on mobile and use lists there. One other place where I‘ve written a million Displayrules is Background color for some HTML-Components. Being able to use a similar workflow on html components would be sick

well actually I keep running into problems with it. From my testing it seems like as soon as I enable multi select updates it stops working with this error