mirror of
https://github.com/servo/servo.git
synced 2025-08-11 00:15:32 +01:00
style: Support calc() in color functions.
This commit is contained in:
parent
e91c9ec7fe
commit
23d69ea77d
7 changed files with 230 additions and 72 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue