mirror of
https://github.com/wekan/wekan.git
synced 2026-11-26 20:45:07 -05:00
- The General/ level is gone: its 109 files moved up into the folders of the same name, and its topic table is the "Shared topics" section of Features.md. - Accessibility is one folder, docs/Features/Accessibility/, with the Admin Panel's accessibility page in it. - Every folder's main page is README.md (110 X/X.md pages renamed with git mv, five merged with an existing README.md, 26 index pages added for folders that had none), so a folder opened on GitHub shows its page. - The 73 "# Moved" forwarding pages are deleted, with the folders that held only them; every link that went to one goes to its final page. - docs/Features/README.md has the website's "Features in WeKan" overview, each feature linking to its page here. 1,129 Markdown links in 262 files and 352 doc paths in code, tests, compose, snap and release files follow. tests/docsFeaturesLayout.test.cjs fails when General/ or a "# Moved" page comes back, a folder has no README.md, or a relative link in the docs or README.md does not resolve. Thanks to xet7 !
5.5 KiB
5.5 KiB
Swimlane menu / Select Color
What it is
Swimlane menu (☰ in the swimlane header) → Select Color opens Choose a
color (setSwimlaneColorPopup in
client/components/swimlanes/swimlaneHeader.jade). It gives a swimlane's
header a colour, so lanes for different teams or kinds of work can be told
apart at a glance. Besides the named palette colours, any colour can be picked
from the browser's colour wheel, and the header text is then made readable on
it automatically.
Read more
- Web colors - the named colours
and the
#rrggbbhex notation, on Wikipedia. - Relative luminance and the WCAG 2.1 definition that the readable text colour is computed from.
<input type="color">on MDN - the colour wheel the Custom color control uses.- In WeKan: List menu / Set Color, Swimlanes.
How to use it
- Open the board in the Swimlanes view.
- Click ☰ (Swimlane Actions) in the swimlane header.
- Under Appearance, choose Select Color. The popup Choose a color opens.
- Click one of the palette colours (the current one has a check mark), or pick any colour with Custom color.
- Click Save. To take the colour away again, open the popup and click Remove.
Who sees it
Only a board admin. The swimlane menu itself is shown to a board member who is not Comment only, Read only, Read assigned only or Worker.
The popup
| Control | What it does |
|---|---|
| Palette | picks one of the named colours (SWIMLANE_COLORS, models/metadata/colors.js); the current one has a check mark |
| Custom color | the browser's colour wheel; the chosen #rrggbb value is kept as a custom colour (#5514) |
| Save | saves the chosen colour |
| Remove | removes the swimlane's colour |
How the numbers are calculated
- The palette has 25 named colours, the
ALLOWED_COLORSof config/const.js (white, green, yellow, orange, red, purple, blue, sky, lime, pink, black, silver, peachpuff, crimson, plum, darkgreen, slateblue, magenta, gold, navy, gray, saddlebrown, paleturquoise, mistyrose, indigo). - A custom colour must be a full six-digit
#rrggbbhex value (isHexColorin models/lib/contrastColor.js). - The text colour on a custom colour is
contrastText()in the same file: each sRGB channelc = value / 255is linearized (c / 12.92whenc <= 0.03928, otherwise((c + 0.055) / 1.055) ^ 2.4), the relative luminance is0.2126 R + 0.7152 G + 0.0722 B, and the text is black (#000000) when the luminance is above0.179, otherwise white (#ffffff). 0.179 is the luminance at which black and white text have the same WCAG contrast ratio.
How it works in WeKan
- The colour is saved on the swimlane (
swimlane.color,setColorin models/swimlanes.js). A value that is neither a palette colour nor a valid hex colour is saved as no colour (normalizeListColorin models/lists.js); the schema'scustom()check refuses anything else. - The swimlane header is drawn in that colour: a palette colour by its
swimlane-<name>CSS class, a custom colour inline with a readable text colour (colorClass,colorStyle). - The popup is
setSwimlaneColorPopupin client/components/swimlanes/swimlaneHeader.jade and.js; the menu entry is inside thecurrentUser.isBoardAdmincheck. - Tests: tests/contrastColor.test.cjs, tests/customColorContrast.test.cjs, tests/listSwimlaneColorSubpath.test.cjs.
Unlike List menu / Set Color there is no option for cards to follow the swimlane's colour.
Commits
- Group the swimlane menu; Select Color sits under Appearance
- Every board theme and every chosen colour is readable
- Custom colour wheel with automatic readable text contrast
- Setting a swimlane colour to silver no longer saves it as None
- The importer validates swimlane colours against the allowed values
- Fix Set Color of swimlane, list and card
- Changing a swimlane colour no longer reloads the page
- Do not leave silver unset in the swimlane CSS
- Import each swimlane colour from a WeKan export
- Add colours to swimlanes