style: Support calc() in color functions.

This commit is contained in:
Emilio Cobos Álvarez 2017-12-02 00:07:52 +01:00
parent e91c9ec7fe
commit 23d69ea77d
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
7 changed files with 230 additions and 72 deletions

View file

@ -81,6 +81,13 @@ impl Angle {
self.value.radians()
}
/// Returns the amount of degrees this angle represents.
#[inline]
pub fn degrees(self) -> f32 {
use std::f32::consts::PI;
self.radians() * 360. / (2. * PI)
}
/// Returns `0deg`.
pub fn zero() -> Self {
Self::from_degrees(0.0, false)