style: Document the StyleComplexColor sugar.

This commit is contained in:
Emilio Cobos Álvarez 2017-01-02 01:56:08 +01:00
parent 51134b9dc8
commit d10cc314fe
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! Rust helpers to interact with Gecko's StyleComplexColor.
use cssparser::Color; use cssparser::Color;
use gecko::values::{convert_nscolor_to_rgba, convert_rgba_to_nscolor}; use gecko::values::{convert_nscolor_to_rgba, convert_rgba_to_nscolor};
use gecko_bindings::structs::{nscolor, StyleComplexColor}; use gecko_bindings::structs::{nscolor, StyleComplexColor};
@ -17,6 +19,7 @@ impl From<nscolor> for StyleComplexColor {
} }
impl StyleComplexColor { impl StyleComplexColor {
/// Create a `StyleComplexColor` value that represents `currentColor`.
pub fn current_color() -> Self { pub fn current_color() -> Self {
StyleComplexColor { StyleComplexColor {
mColor: 0, mColor: 0,
@ -25,6 +28,7 @@ impl StyleComplexColor {
} }
} }
/// Create a `StyleComplexColor` value that represents `auto`.
pub fn auto() -> Self { pub fn auto() -> Self {
StyleComplexColor { StyleComplexColor {
mColor: 0, mColor: 0,