Skip to content

Rgba does not store Option as component #352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 24, 2023

Conversation

tiaanl
Copy link
Collaborator

@tiaanl tiaanl commented Jul 24, 2023

Legacy rgb/rgba syntax does not allow the "none" keyword and although the modern rgb/rgba syntax does support it, it is immediately converted to 0, because we never have to serialize back to "none" keywords for rgb/rgba.

Also RGBA is now renamed to Rgba as per common rust naming conventions now that it is not used directly in Gecko any more.

src/color.rs Outdated
@@ -82,44 +82,34 @@ fn normalize_hue(hue: f32) -> f32 {

/// A color with red, green, blue, and alpha components, in a byte each.
#[derive(Clone, Copy, PartialEq, Debug)]
pub struct RGBA {
pub struct Rgba {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should call this LegacyRgba or somesuch?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Makes more sense, fixing.

Legacy `rgb`/`rgba` syntax does not allow the "none" keyword and
although the modern `rgb`/`rgba` syntax does support it, it is
immediately converted to 0, because we never have to serialize back to
"none" keywords for `rgb`/`rgba`.

Also `RGBA` is now renamed to `Rgba` as per common rust naming
conventions now that it is not used directly in Gecko any more.
@tiaanl tiaanl force-pushed the remove-option-from-legacy-rgb branch from 29fab94 to 5c7dd21 Compare July 24, 2023 12:42
@emilio emilio added this pull request to the merge queue Jul 24, 2023
Merged via the queue into servo:master with commit a6b30d8 Jul 24, 2023
@tiaanl tiaanl deleted the remove-option-from-legacy-rgb branch July 24, 2023 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants