pub enum Color {
Static(usize, i32, Color),
Dynamic(usize, Easing, i32, i32, Color, Color),
}Expand description
Color event
Variants§
Trait Implementations§
Source§impl Into<Color> for (i32, Color)
Creates a static Color event with the timestamp and the colorization of the element
impl Into<Color> for (i32, Color)
Creates a static Color event with the timestamp and the colorization of the element
Uses a Linear easing
Example:
use osb::{utils::Color, Sprite};
let time = 0;
let color = Color::from(42, 42, 42);
let mut sprite = Sprite::new("res/sprite.png");
sprite.color_((time, color));Source§impl Into<Color> for (i32, i32, i32, i32)
Creates a static Color event with the timestamp and the colorization of the element
impl Into<Color> for (i32, i32, i32, i32)
Creates a static Color event with the timestamp and the colorization of the element
Uses a Linear easing
Example:
use osb::Sprite;
let time = 0;
let r = 42;
let g = 42;
let b = 42;
let mut sprite = Sprite::new("res/sprite.png");
sprite.color_((time, r, g, b));Source§impl Into<Color> for (i32, i32, Color, Color)
Creates a dynamic Color event with the timestamps and the colorizations of the element
impl Into<Color> for (i32, i32, Color, Color)
Creates a dynamic Color event with the timestamps and the colorizations of the element
Uses a Linear easing
Example:
use osb::{utils::Color, Sprite};
let start_time = 0;
let end_time = 1000;
let start_color = Color::from(0, 0, 0);
let end_color = Color::from(255, 255, 255);
let mut sprite = Sprite::new("res/sprite.png");
sprite.color_((start_time, end_time, start_color, end_color));Source§impl Into<Color> for (i32, i32, i32, i32, i32, i32, i32, i32)
Creates a dynamic Color event with the timestamps and the colorizations of the element
impl Into<Color> for (i32, i32, i32, i32, i32, i32, i32, i32)
Creates a dynamic Color event with the timestamps and the colorizations of the element
Uses a Linear easing
Example:
use osb::{Sprite};
let start_time = 0;
let end_time = 1000;
let start_r = 0;
let start_g = 0;
let start_b = 0;
let end_r = 255;
let end_g = 255;
let end_b = 255;
let mut sprite = Sprite::new("res/sprite.png");
sprite.color_((start_time, end_time, start_r, start_g, start_b, end_r, end_g, end_b));Source§impl Into<Color> for (Easing, i32, i32, Color, Color)
Creates a dynamic Color event with the easing, the timestamps and the colorizations of the element
impl Into<Color> for (Easing, i32, i32, Color, Color)
Creates a dynamic Color event with the easing, the timestamps and the colorizations of the element
Example:
use osb::{utils::Color, Easing, Sprite};
let easing = Easing::Out;
let start_time = 0;
let end_time = 1000;
let start_color = Color::from(0, 0, 0);
let end_color = Color::from(255, 255, 255);
let mut sprite = Sprite::new("res/sprite.png");
sprite.color_((easing, start_time, end_time, start_color, end_color));Source§impl Into<Color> for (Easing, i32, i32, i32, i32, i32, i32, i32, i32)
Creates a dynamic Color event with the timestamps and the colorizations of the element
impl Into<Color> for (Easing, i32, i32, i32, i32, i32, i32, i32, i32)
Creates a dynamic Color event with the timestamps and the colorizations of the element
Example:
use osb::{Easing, Sprite};
let easing = Easing::Out;
let start_time = 0;
let end_time = 1000;
let start_r = 0;
let start_g = 0;
let start_b = 0;
let end_r = 255;
let end_g = 255;
let end_b = 255;
let mut sprite = Sprite::new("res/sprite.png");
sprite.color_((easing, start_time, end_time, start_r, start_g, start_b, end_r, end_g, end_b));Auto Trait Implementations§
impl Freeze for Color
impl RefUnwindSafe for Color
impl Send for Color
impl Sync for Color
impl Unpin for Color
impl UnsafeUnpin for Color
impl UnwindSafe for Color
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more