Advertisement
cwchen

[Rust] The RGB model constructor of Color class

Aug 28th, 2017
3,390
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.15 KB | None | 0 0
  1. impl Color {
  2.     // Constructor for RGB model
  3.     pub fn from_rgb(r: u8, g: u8, b: u8) -> Color {
  4.         Color::RGB{ r: r, g: g, b: b }
  5.     }
  6. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement