1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 04:40:03 -04:00

Round the corners of the color picker (#8439)

The color picker's gradients and background checkers now follow the
style's corner radius, giving it a softer look.

This required changing the painting from being Mesh-based to being
texture-based

it's subtle with the default settings:

<img width="286" height="397" alt="Screenshot 2026-08-21 at 15 08 18"
src="https://github.com/user-attachments/assets/3a9d5289-71fb-4f34-8a20-1fe96891ba36"
/>


But you can [increase it](https://github.com/emilk/egui/pull/8445):


<img width="285" height="391" alt="Screenshot 2026-08-21 at 15 08 41"
src="https://github.com/user-attachments/assets/b0dfa7da-5b96-40e0-a80d-1da385d57a1a"
/>


### Before
for reference
<img width="286" height="392" alt="Screenshot 2026-08-21 at 19 08 27"
src="https://github.com/user-attachments/assets/7c754f36-795c-4381-9f9f-1fc8dd9a0264"
/>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Emil Ernerfeldt
2026-08-24 02:28:14 -07:00
committed by GitHub
parent a15a7e6611
commit 726b995608
24 changed files with 411 additions and 155 deletions

View File

@@ -0,0 +1,17 @@
use egui::Color32;
use egui::color_picker::{Alpha, color_picker_color32};
use egui_kittest::Harness;
#[test]
fn color_picker() {
let mut color = Color32::from_rgba_unmultiplied(130, 130, 130, 45);
let mut harness = Harness::builder()
.with_pixels_per_point(2.0)
.build_ui(move |ui| {
ui.spacing_mut().slider_width = 275.0;
color_picker_color32(ui, &mut color, Alpha::OnlyBlend);
});
harness.run();
harness.fit_contents();
harness.snapshot("color_picker");
}

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ed0f9f3ec94ac3d75266343d11cae5842d72fbea3c78f7995b1b0ad5aa3cdcad
size 141933

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3b6f03016682b8a9970d2f425cfd417833b8e532c69bbcfbf8290ccaa8335f3b
size 25938
oid sha256:68351659df756ce331a4eeb147be8d1b4fed39dbbb54a0d6f685997b54dc07a7
size 26327

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:65d1c8766fa8f854806a408a0289a79e942fdf6642be7cf6f4e8924412d31c25
size 30855
oid sha256:65d1d15d78c871eb87224c44d2fe889cc0d7a33eb15aeb4852c10bdb02aa730d
size 30877

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6402e1da2627f143d07e01b1bcbcbfafa174fcf76fd4c1f8b217b5227528a067
size 590792
oid sha256:10d58fa20fe3cc06a98dc79adf6237652b87871d2dc394476ea524ac62f2750b
size 590735

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:eddc77778c52b56763e1906fe9fdc4e575d4c99f3a438dc9f74260f75f13154f
size 745930
oid sha256:1de8583bef3fb9e3530b4a09f498360d37d21c099dd44cd45ee99ccc332d7c1c
size 745855

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bfc46024827dd504be4765a3eab02bb1c27cb870d128285580fa1eb0cff8390c
size 973977
oid sha256:43c1f297b0d3e62483b05efe3eb7089a61944b2e348bc791f0503ccbf6c5ab4a
size 973927

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9658cc6b4dd2dd33356facc6b48cf69f9a86f976ac2dd4f16e362a2fd3f73827
size 1081864
oid sha256:17790adf9f5ba91aa00a22c44303422ed02e71a1ab7b5c1484e13e2a132bd639
size 1081792

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e9918502356af39490dc8056509117dee7b7a290c1cac06767d3478c38bb27d3
size 1131255
oid sha256:b434961f2ac616e2563aa2ff9e706158190dfcc2713de6fd7740290e603c8a1b
size 1131176

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:95cd6e583873e36399df82133b8eca8b3be34ea8d5c6d36cb653288c8cf3b53f
size 1363872
oid sha256:de79f0a3dacdf5387faaeeb64f8939ff5912e362d8d649d6e25fd3dbda940325
size 1363775

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a7028aa93b6212054dc41d3daf88454d53e6b05d670b987f2d918f6aa0b38324
size 46455
oid sha256:a62ed81b1693cd7eea2099c0840d82318d27e382f88ca1dd15ba9e2a59e3cf4b
size 46677

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:603afb5653a960161a6884647bc51e8547160ffab186d7a9a2b4839ed77e7d0b
size 120323
oid sha256:5ad40e8b41882e3456569c8cb2e831d33fafa910989674e05b20568798528154
size 120579

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:26c857faec0666f207182166d34bc9980f1cf3165813a9128cd24d1429156933
size 37357
oid sha256:ea03f6b0e0071910cf2b4279549fb0347cd6a9f8d0334830ce4f34f5824a1ef9
size 37595

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:46af578e5e90d0591644707b9ad305615ee098182ffa14c6ccf29bdbbc2a0bef
size 65919
oid sha256:952df0869c400d8b1f5dc0a33cb7a8be1fa30d91929e57b7c33af0cfbc9cead4
size 66043

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:71433ceac92b327d2c5109302c479d398b64283a75327bba6d584654a0c53f3e
size 153251
oid sha256:066067e34d47aa8d2631e64b2ea37d94bae77bdfb1af9337f34f724e1ff14cb6
size 153589

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:196d957732cc5a0d0b8b30875b5ade59236c288293e2cc8a53f9ed6c89edad79
size 60722
oid sha256:0d79861c18cbaf2f2ab738d0a5633f354c11a52b8a8e87c623e624ecdfcc6965
size 60813

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8d26c20506fffcbca07c3eb0a986357129590684da83f8cdd1a56c65cf3e6452
size 147925
oid sha256:cde27ba5614f4bd5553d609b23e6dd78aea113c88443de42fa47aa85929c9455
size 148235