Color: Recent Colors keeps the last 30 colors used, across documents

Recent Colors now keeps up to 30 solid colors instead of 10, newest
first and each once; applying a 31st drops the oldest. The Session
holds the list, so it stays the same when another document is opened
or made active, and it lasts for the session.

The Color and Swatches panels wrap the chips onto further rows when
the panel is too narrow for one row, so every color can be clicked.
A list that fits one row draws as before.

Docs: paint.recent params text, docs/mcp.md, docs/target-app-parity.md.
This commit is contained in:
dotCooCoo
2026-11-08 12:47:51 +07:00
committed by bflatastic
parent 19fd8d1d5e
commit c32f44ba3a
6 changed files with 110 additions and 15 deletions
+4 -3
View File
@@ -128,7 +128,7 @@ pub fn proxy_specs() -> Vec<CommandSpec> {
"Recent Colors",
[],
None,
"{} → {colors: [{hex, color}] newest first (fed by every paint command and the eyedropper), lastColor: {hex, color}, lastGradient: gradient paint}",
"{} → {colors: [{hex, color}] newest first, at most 30, each once, kept across documents for the session (fed by every paint command and the eyedropper), lastColor: {hex, color}, lastGradient: gradient paint}",
always,
|s, _| {
let c = |c: &Color| json!({"hex": c.to_hex(), "color": c});
@@ -152,8 +152,9 @@ pub fn proxy_specs() -> Vec<CommandSpec> {
}
impl Session {
/// How many colours the Recent Colors rows keep.
pub const RECENT_MAX: usize = 10;
/// How many colors Recent Colors keeps. The Session holds the list, so it stays the same when
/// another document is opened or made active.
pub const RECENT_MAX: usize = 30;
/// Remember an applied paint: a solid colour becomes the last colour and the newest recent
/// colour, a gradient the last gradient. During a live preview this waits for the commit.