summaryrefslogtreecommitdiffstats
path: root/examples/tour.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2019-12-05 00:19:13 +0100
committerLibravatar GitHub <noreply@github.com>2019-12-05 00:19:13 +0100
commitf87ddf1056327551b4a2bba9e98cbb7816b6666c (patch)
tree256269a85712c96d6e43b02c9343a8265599b081 /examples/tour.rs
parented045b45ba9490b6020618fb13c7dbc3ea5032ab (diff)
parent33ad332ce99fff5de8e50a5b5c98f3ce181c311a (diff)
downloadiced-f87ddf1056327551b4a2bba9e98cbb7816b6666c.tar.gz
iced-f87ddf1056327551b4a2bba9e98cbb7816b6666c.tar.bz2
iced-f87ddf1056327551b4a2bba9e98cbb7816b6666c.zip
Merge pull request #107 from Maldela/background
Implemented `From<Color` for `Background`
Diffstat (limited to 'examples/tour.rs')
-rw-r--r--examples/tour.rs19
1 files changed, 6 insertions, 13 deletions
diff --git a/examples/tour.rs b/examples/tour.rs
index 0121c3bd..53a8e662 100644
--- a/examples/tour.rs
+++ b/examples/tour.rs
@@ -1,5 +1,5 @@
use iced::{
- button, scrollable, slider, text_input, Background, Button, Checkbox,
+ button, scrollable, slider, text_input, Button, Checkbox,
Color, Column, Container, Element, HorizontalAlignment, Image, Length,
Radio, Row, Sandbox, Scrollable, Settings, Slider, Text, TextInput,
};
@@ -684,24 +684,17 @@ fn primary_button<'a, Message>(
state: &'a mut button::State,
label: &str,
) -> Button<'a, Message> {
- button(state, label).background(Background::Color(Color {
- r: 0.11,
- g: 0.42,
- b: 0.87,
- a: 1.0,
- }))
+ button(state, label)
+ .background(Color::from_rgb(0.11, 0.42, 0.87).into())
}
fn secondary_button<'a, Message>(
state: &'a mut button::State,
label: &str,
) -> Button<'a, Message> {
- button(state, label).background(Background::Color(Color {
- r: 0.4,
- g: 0.4,
- b: 0.4,
- a: 1.0,
- }))
+ button(state, label)
+ .background(Color::from_rgb(0.4, 0.4, 0.4).into())
+
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]