Skip to content
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

Accept 8digit Hex color code #221

Merged
merged 26 commits into from
Jun 10, 2022
Merged

Accept 8digit Hex color code #221

merged 26 commits into from
Jun 10, 2022

Conversation

ADITIRAI290698
Copy link
Contributor

i will be converting alpha from hexa to deci.

@ADITIRAI290698
Copy link
Contributor Author

i have corrected the code for alpha. please let me know if the change is right or wrong.

if v.starts_with("#") && v.len() == 9 {
let (_, value_string) = string.split_at(1);

let iv = u64::from_str_radix(value_string, 16).unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

You can not call unwrap() like this, as then the entire process will panic and die. If you can not parse something, let css_color_parser() parse it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Or return an error like you have done few lines down.

@amitu
Copy link
Contributor

amitu commented Jun 3, 2022

@ADITIRAI290698 please fix the title of this PR. Also please try to add some tests for the feature and ensure tests are passing. Checkout interpreter.rs which has a lot of tests, you can add "integration test" there. You can also add add "unit test" in the same module where you have implemented the function.

@amitu
Copy link
Contributor

amitu commented Jun 3, 2022

@ADITIRAI290698 also if you are creating a PR to fix an issue, mention the issue URL in the PR description so there is context.

@Arpita-Jaiswal Arpita-Jaiswal changed the title wip Accept 8digit Hex color code Jun 8, 2022
@Arpita-Jaiswal Arpita-Jaiswal linked an issue Jun 8, 2022 that may be closed by this pull request
@Arpita-Jaiswal
Copy link
Contributor

Remove the examples/.packages/ folder and all it's contents

src/p2/element.rs Outdated Show resolved Hide resolved
@Arpita-Jaiswal Arpita-Jaiswal merged commit 62fe701 into main Jun 10, 2022
@Arpita-Jaiswal Arpita-Jaiswal deleted the hex_color_fix branch June 10, 2022 04:47
@amitu amitu added the amitu-1 label Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

8 digit hexadecimal color code not working
3 participants