1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 14:20:04 -04:00

Support additive colors in color picker

This commit is contained in:
Emil Ernerfeldt
2021-01-03 18:03:11 +01:00
parent 5c8df6925d
commit 10a23d18e1
17 changed files with 239 additions and 106 deletions

View File

@@ -58,7 +58,7 @@ impl FractalClock {
ui.expand_to_include_rect(painter.clip_rect());
Frame::popup(ui.style())
.fill(Rgba::luminance_alpha(0.02, 0.5).into())
.fill(Rgba::from_luminance_alpha(0.02, 0.5).into())
.stroke(Stroke::none())
.show(ui, |ui| {
ui.set_max_width(270.0);
@@ -160,7 +160,7 @@ impl FractalClock {
for (i, hand) in hands.iter().enumerate() {
let center = pos2(0.0, 0.0);
let end = center + hand.vec;
paint_line([center, end], Color32::additive_luminance(255), width);
paint_line([center, end], Color32::from_additive_luminance(255), width);
if i < 2 {
nodes.push(Node {
pos: end,
@@ -190,7 +190,7 @@ impl FractalClock {
};
paint_line(
[a.pos, b.pos],
Color32::additive_luminance(luminance_u8),
Color32::from_additive_luminance(luminance_u8),
width,
);
new_nodes.push(b);