Skip to content

feat: add color converter - #189

Open
20157693 wants to merge 1 commit into
codepiyusss:mainfrom
20157693:feat/color-connverter
Open

20157693 wants to merge 1 commit into
codepiyusss:mainfrom
20157693:feat/color-connverter

Conversation

@20157693

Copy link
Copy Markdown
Contributor

What does this PR do?

Added a color converter feature from RGB to HEX, HSV, HSL and from HEX to RGB.
The command is fixit color command that uses the native colorsys module to convert colors:

  • rgb2hsv and rgb2hsl take in an RGB tuple (each one of 0-255) and outputs (rounded) H in degrees and S, V or L in percent
  • rgb2hex and hex2rgb interchange from RGB to Hex. hex2rgb accepts Hex with or without #, and 6 or 3 letters (CSS format)

For example:

fixit color rgb2hsv 255 0 0 will return 0 100 100
fixit color rgb2hsl 255 0 0 will return 0 100 50
fixit color rgb2hex 255 255 255 will return #FFFFFF
fixit color hex2rgb FFFFFF will return 255 255 255

Related issue

Closes #177

Checklist

  • I commented on the issue first and was assigned
  • I removed the xfail marker (if fixing a bug)
  • I added or updated tests
  • pytest passes locally
  • This PR only addresses one issue

@20157693

Copy link
Copy Markdown
Contributor Author

Well I think it's failing a check but it's not on my side since all tests pass. Happy to help with that in a separate PR if needed.

@codepiyusss codepiyusss left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The CI failure is from the Greet New Contributors workflow, not pytest. actions/[email protected] reports that issue_message was not supplied because .github/workflows/welcome.yml uses issue-message and pr-message as input names.

Please update those keys to issue_message and pr_message in the workflow. This should restore the welcome check; it can then be merged independently of the color converter implementation.

@20157693

Copy link
Copy Markdown
Contributor Author

So essentially replace hyphens with underscores. Imma do that in a separate PR, then the checks shall pass.

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.

Feature: Native Text-Based Colour Converter

2 participants