Add RGBA and HSVA impls
This commit is contained in:
parent
7e70e826f2
commit
8adad636d1
2 changed files with 17 additions and 0 deletions
|
@ -116,6 +116,16 @@ impl<C: ToHSV, T:Clone + Channel + Float> ToHSVA for (C, T) {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T:Clone + Channel + Float> ToHSVA for HSVA<T> {
|
||||
#[inline]
|
||||
pub fn to_hsva<U:Channel + Float>(&self) -> HSVA<U> {
|
||||
HSVA::new((*self).h.to_channel(),
|
||||
(*self).s.to_channel(),
|
||||
(*self).v.to_channel(),
|
||||
(*self).a.to_channel())
|
||||
}
|
||||
}
|
||||
|
||||
impl<T:Clone + Channel + Float> ToRGBA for HSVA<T> {
|
||||
#[inline]
|
||||
pub fn to_rgba<U:Channel>(&self) -> RGBA<U> {
|
||||
|
|
|
@ -36,6 +36,13 @@ pub trait ToRGB {
|
|||
pub fn to_rgb<U:Channel>(&self) -> RGB<U>;
|
||||
}
|
||||
|
||||
impl ToRGB for u64 {
|
||||
#[inline]
|
||||
pub fn to_rgb<U:Channel>(&self) -> RGB<U> {
|
||||
fail!("Not yet implemented")
|
||||
}
|
||||
}
|
||||
|
||||
impl<T:Clone + Channel> ToRGB for RGB<T> {
|
||||
#[inline]
|
||||
pub fn to_rgb<U:Channel>(&self) -> RGB<U> {
|
||||
|
|
Loading…
Reference in a new issue