Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: Add grayscale method to Colorus class#6

Merged
supitsdu merged 4 commits intomainfrom
feature
May 2, 2024
Merged

feat: Add grayscale method to Colorus class#6
supitsdu merged 4 commits intomainfrom
feature

Conversation

@supitsdu
Copy link
Owner

@supitsdu supitsdu commented May 2, 2024

This commit adds a new method grayscale to the Colorus class. The grayscale method converts the current color to grayscale, with an option to use the NTSC formula for conversion. Additionally, Jest tests have been added to ensure the correctness of the grayscale conversion functionality.

The tests cover various scenarios, including conversion without the NTSC formula, conversion with the NTSC formula, preservation of alpha channel, and handling of black and white colors.

Details:

  • Added grayscale method to the Colorus class
  • Implemented grayscale conversion using the rgbToGray function from compose module
  • Added Jest tests for the grayscale method

This commit adds a new method `grayscale` to the Colorus class. The `grayscale` method converts the current color to grayscale, with an option to use the NTSC formula for conversion. Additionally, Jest tests have been added to ensure the correctness of the grayscale conversion functionality.

The tests cover various scenarios, including conversion without the NTSC formula, conversion with the NTSC formula, preservation of alpha channel, and handling of black and white colors.

**Details:**
- Added `grayscale` method to the Colorus class
- Implemented grayscale conversion using the rgbToGray function from compose module
- Added Jest tests for the grayscale method
@supitsdu supitsdu added the ✨ Enhancement New feature or request label May 2, 2024
@supitsdu supitsdu merged commit 927b562 into main May 2, 2024
@supitsdu supitsdu deleted the feature branch May 2, 2024 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant