Scrum, Set color, Similar cards, Subtasks, Suggested members, Time tracking, Watch and Star, Whiteboard, Cover image, Locations and Stickers follow one structure. Corrected from the code: Filter: Subtasks is in the Subtasks heading's hamburger, the whiteboard keeps the drawing's own size, the card-field switches are in Admin Panel / Settings / Features, the map links follow the chosen provider of eleven, Time tracking describes the card's spent time and time by day, and Scrum now has native sprints. Thanks to xet7 !
6.6 KiB
Card menu / Set color
What it is
Set color gives one card a background colour of its own, so it stands out on the board: urgent work in red, a customer's cards in their colour, or any meaning the team agrees on. The colour is either one of WeKan's named colours or any custom colour picked from the colour wheel, and the card's text is made readable on it automatically.
Read more
- Wikipedia: Web colors, RGB color model and Contrast (vision).
- WCAG 2.1, Contrast (Minimum), the rule the text colour follows.
- MDN:
<input type="color">, the browser's colour wheel used for Custom color. - In WeKan: List menu / Set Color, Multi-Selection and Board Settings / Card.
How to use it
- Open the card and click the card menu (☰ in the opened card's header, Card Actions).
- Under Appearance, choose Set color. This opens the card's colour
popup (
setCardColorPopupin client/components/cards/cardDetails.jade). - Click a colour of the palette, one of the custom swatches, or pick one under Custom color.
- Click Save. Remove takes the card's colour away.
| Control | What it does |
|---|---|
| Palette | the named colours (ALLOWED_COLORS) except white; the current one has a check mark |
| Custom swatches | the custom #rrggbb colours already used by cards of this board |
| Custom color | the browser's colour wheel (#5514) |
| Save | saves the chosen colour on the card |
| Remove | removes the card's colour |
Who sees it: somebody who may change the card (canModifyCard, which
includes the card's list permission), and who
is not a Worker.
Where it shows: on the minicard and in the opened card's header, unless
Card color is turned off for that place in
Board Settings / Card
(allowsCardColorOnMinicard, allowsCardColorOnCard).
A card without a colour of its own can be shown in its list's colour; see List menu / Set Color. The card's own colour always wins.
Several cards can be coloured at once from Multi-Selection.
How the numbers are calculated
- Palette: the 25 named colours of
ALLOWED_COLORSin config/const.js less white, so 24 swatches. Choosing white, or Remove, stores no colour (setColorin models/cards.js writesnull). - Custom swatches (
customColorsInUsein models/lib/contrastColor.js): the#rrggbbcolours of the board's non-archived cards, lower-cased, at most 12, the most used first and equal counts in the order first seen. - Colour wheel: opens at the card's current colour as hex, or
#0079bfwhen it has none. - Text colour on a custom colour (
contrastText): the background's WCAG relative luminance0.2126 R + 0.7152 G + 0.0722 B(each channel linearized from sRGB); above 0.179 the text is black (#000000), otherwise white (#ffffff). 0.179 is where black and white text have the same contrast ratio. - Shown colour (
effectiveCardColorin models/lib/cardDisplayColor.js): the card's own colour; else the list's colour when the list says so and it is not white; else none.
How it works in WeKan
- The card's
colorfield (models/cards.js) accepts a named colour or a strict#rrggbbhex (isAllowedCardColor); anything else is refused by the schema.colorClass()gives a named colour its CSS class,colorStyle()sets a custom one inline with its readable text colour. - The popup is
setCardColorPopupand the sharedcustomCardColorSwatchesin client/components/cards/cardDetails.jade, with its helpers and events in cardDetails.js; Save callscard.setColor, which writes the real card of a linked card. - Tests: tests/contrastColor.test.cjs, tests/customColorContrast.test.cjs, tests/cardDisplayColor.test.cjs, tests/multiSelectionCustomColor.test.cjs and tests/playwright/specs/multiselection-custom-color.e2e.js.
Commits
- Every board theme and every colour a member chooses is readable
- Set color sits under the Appearance heading of the card menu
- The card actions menu in the maintainer's order
- A list colours the cards that have no colour of their own
- Custom card colour on all selected cards, and the board's custom swatches
- Board Settings / Card rows for the card colour on the card and the minicard
- Colour wheel for a custom RGB / hex card colour, with readable text
- Fix Set Color of swimlane, list and card
- Changing the card colour closes the popup without reloading the board
- Removing the card colour closes the popup
- The card colour no longer reloads the board
- Changing a card colour no longer reloads the whole page