Ember, an accent the colour of iron at working heat (copper in light), and Anvil, a background of warm soot in dark and ash in light, join the colour presets
Browse files at this commitb9f184c36e495475577a1a82de6c179a8b070147Parent: 90755a5- feat
- Ember, an accent the colour of iron at working heat (copper in light), and Anvil, a background of warm soot in dark and ash in light, join the colour presets
- Ember was a retired id, so a stored Ember now shows the new colour instead of falling back to Sage
5 changed files +72 -9
- crates/forge-web/src/accent.rs +5 -5
- crates/forge-web/src/accent_palette.rs +60 -0
- crates/forge-web/src/i18n/accents.rs +4 -0
- crates/forge-web/src/pages/settings_appearance.rs +2 -3
- crates/forge-web/src/views/mod.rs +1 -1
crates/forge-web/src/accent.rsmodified+5 -5
| @@ -310,13 +310,13 @@ mod tests { | ||
| 310 | 310 | fn the_presets_are_offered_in_picker_order_and_removed_ids_are_not() { |
| 311 | 311 | assert_eq!( |
| 312 | 312 | ids().collect::<Vec<_>>(), |
| 313 | - ["sage", "spark", "ocean", "plum", "rose", "gold"] | |
| 313 | + ["sage", "spark", "ocean", "plum", "rose", "gold", "ember"] | |
| 314 | 314 | ); |
| 315 | 315 | assert_eq!( |
| 316 | 316 | base_ids().collect::<Vec<_>>(), |
| 317 | - ["fern", "spark", "graphite", "dusk", "ink"] | |
| 317 | + ["fern", "spark", "graphite", "dusk", "ink", "anvil"] | |
| 318 | 318 | ); |
| 319 | - for id in ["ember", "ochre", "teal", "Sage", "sage ", "terracotta"] { | |
| 319 | + for id in ["ochre", "teal", "Sage", "sage ", "terracotta"] { | |
| 320 | 320 | assert!(!is_offered(id), "{id}"); |
| 321 | 321 | } |
| 322 | 322 | for id in ["stone", "mist", "Fern", "dune", "slate-blue"] { |
| @@ -330,7 +330,7 @@ mod tests { | ||
| 330 | 330 | assert_eq!(resolve("removed-palette").id, DEFAULT); |
| 331 | 331 | assert_eq!(resolve("").id, DEFAULT); |
| 332 | 332 | assert_eq!(accent_id("ocean"), "ocean"); |
| 333 | - assert_eq!(accent_id("ember"), DEFAULT); | |
| 333 | + assert_eq!(accent_id("terracotta"), DEFAULT); | |
| 334 | 334 | assert_eq!(accent_id(""), DEFAULT); |
| 335 | 335 | assert!(is_offered("plum")); |
| 336 | 336 | assert!(!is_offered("removed-palette")); |
| @@ -389,7 +389,7 @@ mod tests { | ||
| 389 | 389 | accent_tokens(215, 50, false).accent |
| 390 | 390 | ); |
| 391 | 391 | assert_eq!(swatch("hue-215", true), accent_tokens(215, 50, true).accent); |
| 392 | - assert_eq!(swatch("ember", false), swatch("sage", false)); | |
| 392 | + assert_eq!(swatch("terracotta", false), swatch("sage", false)); | |
| 393 | 393 | let (bg, text) = base_swatch("fern", false); |
| 394 | 394 | assert_eq!((bg.as_str(), text.as_str()), ("#F6F8F5", "#1E2420")); |
| 395 | 395 | let (bg, text) = base_swatch("hue-215", true); |
crates/forge-web/src/accent_palette.rsmodified+60 -0
| @@ -253,6 +253,34 @@ pub const PALETTES: &[Palette] = &[ | ||
| 253 | 253 | hunk_text: "#E8BC4A", |
| 254 | 254 | }, |
| 255 | 255 | }, |
| 256 | + // Ember: iron at working heat, a soft red-orange; copper in light. | |
| 257 | + Palette { | |
| 258 | + id: "ember", | |
| 259 | + light: Tokens { | |
| 260 | + accent: "#B44D1A", | |
| 261 | + accent_ink: "#8F3A12", | |
| 262 | + accent_soft: "#F9E4D6", | |
| 263 | + accent_text: "#FFFFFF", | |
| 264 | + focus: "#8F3A12", | |
| 265 | + public_bg: "#F9E4D6", | |
| 266 | + public_text: "#8F3A12", | |
| 267 | + note: "#8F3A12", | |
| 268 | + hunk_bg: "#FBF0E8", | |
| 269 | + hunk_text: "#883611", | |
| 270 | + }, | |
| 271 | + dark: Tokens { | |
| 272 | + accent: "#E8894A", | |
| 273 | + accent_ink: "#FFB27A", | |
| 274 | + accent_soft: "#3A2416", | |
| 275 | + accent_text: "#1A0E06", | |
| 276 | + focus: "#FFB27A", | |
| 277 | + public_bg: "#3A2416", | |
| 278 | + public_text: "#FFC69A", | |
| 279 | + note: "#FFB27A", | |
| 280 | + hunk_bg: "#24180F", | |
| 281 | + hunk_text: "#F0A066", | |
| 282 | + }, | |
| 283 | + }, | |
| 256 | 284 | ]; |
| 257 | 285 | |
| 258 | 286 | /// The neutral colour tokens one base sets in one theme. The values are CSS colours; |
| @@ -506,4 +534,36 @@ pub const BASES: &[Base] = &[ | ||
| 506 | 534 | ln_text: "#9C9C98", |
| 507 | 535 | }, |
| 508 | 536 | }, |
| 537 | + // Anvil: warm soot and cooled steel in dark, ash in light. | |
| 538 | + Base { | |
| 539 | + id: "anvil", | |
| 540 | + light: BaseTokens { | |
| 541 | + bg: "#F5F2EE", | |
| 542 | + surface: "#FFFDFB", | |
| 543 | + surface_2: "#ECE7E1", | |
| 544 | + text: "#1C1916", | |
| 545 | + text_2: "#3D3631", | |
| 546 | + muted: "#6E645B", | |
| 547 | + border: "#E2DBD3", | |
| 548 | + border_strong: "#CDC3B8", | |
| 549 | + code_bg: "#EFEAE4", | |
| 550 | + private_bg: "#ECE7E1", | |
| 551 | + private_text: "#3D3631", | |
| 552 | + ln_text: "#6A6058", | |
| 553 | + }, | |
| 554 | + dark: BaseTokens { | |
| 555 | + bg: "#131211", | |
| 556 | + surface: "#1B1917", | |
| 557 | + surface_2: "#24211E", | |
| 558 | + text: "#ECE6DF", | |
| 559 | + text_2: "#CFC6BC", | |
| 560 | + muted: "#9C9187", | |
| 561 | + border: "#2F2B27", | |
| 562 | + border_strong: "#3E3934", | |
| 563 | + code_bg: "#0E0D0C", | |
| 564 | + private_bg: "#24211E", | |
| 565 | + private_text: "#CFC6BC", | |
| 566 | + ln_text: "#9C9187", | |
| 567 | + }, | |
| 568 | + }, | |
| 509 | 569 | ]; |
crates/forge-web/src/i18n/accents.rsmodified+4 -0
| @@ -19,6 +19,8 @@ pub fn accent_name(lang: Lang, id: &str) -> &'static str { | ||
| 19 | 19 | ("rose", Lang::Tr) => "Gül", |
| 20 | 20 | ("gold", Lang::En) => "Gold", |
| 21 | 21 | ("gold", Lang::Tr) => "Altın", |
| 22 | + ("ember", Lang::En) => "Ember", | |
| 23 | + ("ember", Lang::Tr) => "Kor", | |
| 22 | 24 | _ => "", |
| 23 | 25 | } |
| 24 | 26 | } |
| @@ -37,6 +39,8 @@ pub fn base_name(lang: Lang, id: &str) -> &'static str { | ||
| 37 | 39 | ("dusk", Lang::Tr) => "Alacakaranlık", |
| 38 | 40 | ("graphite", Lang::En) => "Graphite", |
| 39 | 41 | ("graphite", Lang::Tr) => "Grafit", |
| 42 | + ("anvil", Lang::En) => "Anvil", | |
| 43 | + ("anvil", Lang::Tr) => "Örs", | |
| 40 | 44 | _ => "", |
| 41 | 45 | } |
| 42 | 46 | } |
crates/forge-web/src/pages/settings_appearance.rsmodified+2 -3
| @@ -669,7 +669,7 @@ mod tests { | ||
| 669 | 669 | ); |
| 670 | 670 | |
| 671 | 671 | for id in [ |
| 672 | - "sage", "spark", "ocean", "plum", "rose", "gold", "hue-0", "hue-359", | |
| 672 | + "sage", "spark", "ocean", "plum", "rose", "gold", "ember", "hue-0", "hue-359", | |
| 673 | 673 | ] { |
| 674 | 674 | assert_eq!( |
| 675 | 675 | accent_choice(Lang::En, Some(id), "sage").unwrap(), |
| @@ -681,7 +681,7 @@ mod tests { | ||
| 681 | 681 | "accent upper case {id}" |
| 682 | 682 | ); |
| 683 | 683 | } |
| 684 | - for id in ["fern", "spark", "graphite", "dusk", "ink", "hue-120"] { | |
| 684 | + for id in ["fern", "spark", "graphite", "dusk", "ink", "anvil", "hue-120"] { | |
| 685 | 685 | assert_eq!( |
| 686 | 686 | base_choice(Lang::Tr, Some(id), "fern").unwrap(), |
| 687 | 687 | id, |
| @@ -696,7 +696,6 @@ mod tests { | ||
| 696 | 696 | for id in [ |
| 697 | 697 | "teal", |
| 698 | 698 | "moss", |
| 699 | - "ember", | |
| 700 | 699 | "terracotta", |
| 701 | 700 | "hue-360", |
| 702 | 701 | "hue-07", |
crates/forge-web/src/views/mod.rsmodified+1 -1
| @@ -1642,7 +1642,7 @@ mod shell_tests { | ||
| 1642 | 1642 | assert!(removed.contains("data-base-light=\"fern\""), "{removed}"); |
| 1643 | 1643 | assert!(removed.contains("data-base-dark=\"fern\""), "{removed}"); |
| 1644 | 1644 | // A removed preset (`ochre`, `mist`) falls back too, and a hue passes through as itself. |
| 1645 | - let retired = html_tag_for_colours(&router, &store, "retired", "retired-token", ["ochre", "ember", "mist", "stone"]).await; | |
| 1645 | + let retired = html_tag_for_colours(&router, &store, "retired", "retired-token", ["ochre", "terracotta", "mist", "stone"]).await; | |
| 1646 | 1646 | assert!(retired.contains("data-accent-light=\"sage\""), "{retired}"); |
| 1647 | 1647 | assert!(retired.contains("data-accent-dark=\"sage\""), "{retired}"); |
| 1648 | 1648 | assert!(retired.contains("data-base-light=\"fern\""), "{retired}"); |