@@ -34,7 +34,7 @@ fn serialize_alpha(dest: &mut impl fmt::Write, alpha: f32, legacy_syntax: bool)
34
34
/// A color with red, green, blue, and alpha components, in a byte each.
35
35
#[ derive( Clone , Copy , PartialEq , Debug ) ]
36
36
#[ repr( C ) ]
37
- pub struct Rgba {
37
+ pub struct RGBA {
38
38
/// The red component.
39
39
pub red : u8 ,
40
40
/// The green component.
@@ -45,7 +45,7 @@ pub struct Rgba {
45
45
pub alpha : f32 ,
46
46
}
47
47
48
- impl Rgba {
48
+ impl RGBA {
49
49
/// Constructs a new RGBA value from float components. It expects the red,
50
50
/// green, blue and alpha channels in that order, and all values will be
51
51
/// clamped to the 0.0 ... 1.0 range.
@@ -134,7 +134,7 @@ impl Rgba {
134
134
}
135
135
136
136
#[ cfg( feature = "serde" ) ]
137
- impl Serialize for Rgba {
137
+ impl Serialize for RGBA {
138
138
fn serialize < S > ( & self , serializer : S ) -> Result < S :: Ok , S :: Error >
139
139
where
140
140
S : Serializer ,
@@ -144,17 +144,17 @@ impl Serialize for Rgba {
144
144
}
145
145
146
146
#[ cfg( feature = "serde" ) ]
147
- impl < ' de > Deserialize < ' de > for Rgba {
147
+ impl < ' de > Deserialize < ' de > for RGBA {
148
148
fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
149
149
where
150
150
D : Deserializer < ' de > ,
151
151
{
152
152
let ( r, g, b, a) = Deserialize :: deserialize ( deserializer) ?;
153
- Ok ( Rgba :: new ( r, g, b, a) )
153
+ Ok ( RGBA :: new ( r, g, b, a) )
154
154
}
155
155
}
156
156
157
- impl ToCss for Rgba {
157
+ impl ToCss for RGBA {
158
158
fn to_css < W > ( & self , dest : & mut W ) -> fmt:: Result
159
159
where
160
160
W : fmt:: Write ,
@@ -355,7 +355,7 @@ impl_lch_like!(Oklch, "oklch");
355
355
#[ derive( Clone , Copy , PartialEq , Debug ) ]
356
356
pub enum AbsoluteColor {
357
357
/// Specify sRGB colors directly by their red/green/blue/alpha chanels.
358
- Rgba ( Rgba ) ,
358
+ Rgba ( RGBA ) ,
359
359
/// Specifies a CIELAB color by CIE Lightness and its a- and b-axis hue
360
360
/// coordinates (red/green-ness, and yellow/blue-ness) using the CIE LAB
361
361
/// rectangular coordinate model.
@@ -407,7 +407,7 @@ pub(crate) const fn rgb(red: u8, green: u8, blue: u8) -> Color {
407
407
408
408
#[ inline]
409
409
pub ( crate ) const fn rgba ( red : u8 , green : u8 , blue : u8 , alpha : f32 ) -> Color {
410
- Color :: Absolute ( AbsoluteColor :: Rgba ( Rgba :: new ( red, green, blue, alpha) ) )
410
+ Color :: Absolute ( AbsoluteColor :: Rgba ( RGBA :: new ( red, green, blue, alpha) ) )
411
411
}
412
412
413
413
/// A <color> value.
@@ -565,7 +565,7 @@ impl Color {
565
565
let location = input. current_source_location ( ) ;
566
566
let token = input. next ( ) ?;
567
567
match * token {
568
- Token :: Hash ( ref value) | Token :: IDHash ( ref value) => Rgba :: parse_hash ( value. as_bytes ( ) )
568
+ Token :: Hash ( ref value) | Token :: IDHash ( ref value) => RGBA :: parse_hash ( value. as_bytes ( ) )
569
569
. map ( |rgba| Color :: Absolute ( AbsoluteColor :: Rgba ( rgba) ) ) ,
570
570
Token :: Ident ( ref value) => parse_color_keyword ( & * value) ,
571
571
Token :: Function ( ref name) => {
0 commit comments