Skip to content

Commit e7ec065

Browse files
Change color type to use f32 values internally (#9820)
* Change Color type to be f32 internally but no other changes * Add missing clamp * Add round function as we're not on MSRV 1.90+ * Prepare for being able to switch between u8s and f32s * [autofix.ci] apply automated fixes * Fix Display impl * Add feature flag for 8-bit color values. Name to be bikeshed * Fix brighter-darker test * Update test screenshot * Remove unused Float trait import * Add cfg thing for not(cbindgen) * Change Channel to float in cbindgen * Change the cpp color type for uint8_t for now * Opt cpp into 8-bit-color * Switch feature around --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 7605850 commit e7ec065

File tree

4 files changed

+158
-76
lines changed

4 files changed

+158
-76
lines changed

api/cpp/cbindgen.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ fn default_config() -> cbindgen::Config {
234234
// therefore it is ok to reinterpret_cast
235235
("MenuEntryModel".into(), "std::shared_ptr<slint::Model<MenuEntry>>".into()),
236236
("Coord".into(), "float".into()),
237+
("Channel".into(), "uint8_t".into()),
237238
]
238239
.iter()
239240
.cloned()
@@ -397,6 +398,7 @@ fn gen_corelib(
397398
"MenuEntryModel",
398399
"MenuEntryArg",
399400
"Coord",
401+
"Channel",
400402
"LogicalRect",
401403
"LogicalPoint",
402404
"LogicalPosition",

internal/core/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ unstable-wgpu-27 = ["dep:wgpu-27"]
7474

7575
tr = ["dep:tr"]
7676

77+
32-bit-color = []
7778
default = ["std", "unicode"]
7879

7980
shared-parley = ["shared-fontique", "dep:parley", "dep:skrifa"]

0 commit comments

Comments
 (0)