summaryrefslogtreecommitdiffstats
path: root/examples/gradient/src
diff options
context:
space:
mode:
authorLibravatar Héctor <hector@hecrj.dev>2025-01-27 01:27:26 +0100
committerLibravatar GitHub <noreply@github.com>2025-01-27 01:27:26 +0100
commitda1726b134ae084dd76b9e0a1107a771f69ed7c9 (patch)
treee107cea585febbf265105662b6fc564a23aaf845 /examples/gradient/src
parent3dc601415dc08bea4376cf92ecf7de3a0f0ba5ff (diff)
parent81f05f00c2f1a72567b057a8ace54860223b1248 (diff)
downloadiced-da1726b134ae084dd76b9e0a1107a771f69ed7c9.tar.gz
iced-da1726b134ae084dd76b9e0a1107a771f69ed7c9.tar.bz2
iced-da1726b134ae084dd76b9e0a1107a771f69ed7c9.zip
Merge pull request #2749 from rhysd/const-from-rgb8
Make `Color::from_rgb8` and `Color::from_rgba8` const
Diffstat (limited to 'examples/gradient/src')
-rw-r--r--examples/gradient/src/main.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/gradient/src/main.rs b/examples/gradient/src/main.rs
index 910ea9fc..428ef6fb 100644
--- a/examples/gradient/src/main.rs
+++ b/examples/gradient/src/main.rs
@@ -3,7 +3,7 @@ use iced::theme;
use iced::widget::{
checkbox, column, container, horizontal_space, row, slider, text,
};
-use iced::{Center, Color, Element, Fill, Radians, Theme};
+use iced::{color, Center, Color, Element, Fill, Radians, Theme};
pub fn main() -> iced::Result {
tracing_subscriber::fmt::init();
@@ -34,7 +34,7 @@ impl Gradient {
fn new() -> Self {
Self {
start: Color::WHITE,
- end: Color::new(0.0, 0.0, 1.0, 1.0),
+ end: color!(0x0000ff),
angle: Radians(0.0),
transparent: false,
}