-
-
Notifications
You must be signed in to change notification settings - Fork 944
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
feat: color module #801
feat: color module #801
Conversation
…anges feat: color module locales changes
Codecov Report
@@ Coverage Diff @@
## main #801 +/- ##
==========================================
- Coverage 99.65% 99.65% -0.01%
==========================================
Files 1988 2007 +19
Lines 211108 212073 +965
Branches 909 972 +63
==========================================
+ Hits 210384 211333 +949
- Misses 705 720 +15
- Partials 19 20 +1
|
Thank you very much for your Pull Request :) we a discussing in what version of faker it would make sense to put this feature into, but it looks like it will go into faker v7. We will update you on the process :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll review it, when we start with v7.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should think about if we want to go more in a direction of supporting CSS stuff or more like generating values for e.g. three.js
.
For CSS I would also like to see something like get a color gamut display-p3
But for three.js I would like to have e.g. possibility to generate colors for a specific channel or stuff like that: https://threejs.org/docs/#api/en/math/Color
And maybe there is also something else non-css/non-three.js
@Shinigami92 I will look into this further and update the PR description with new tasks. |
Thank you! Sorry been a little busy with school and work. I will try to contribute where ever I can still. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please copy the impl signature so it will be picked up as the last api signature.
AFAICT you don't have to add the jsdocs to the impl signature.
looks like the hu definition file was missed in faker-js#801 when migrating from faker.commerce.color to faker.color.human
Resolves:
#286
Key Changes:
commerce
to its owncolor
modulecommerce
module (since v7 until v8)RGB
generation and tests (Red Green Blue)RGBA
generation and tests (Red Green Blue Alpha)CMYK
generation and tests (Cyan, Magenta, Yellow, and Key (black))HSL
generation and tests (Hue, Saturation, Lightness)HSLA
generation and tests (Hue, Saturation, Lightness, Alpha)HWB
generation and tests (Hue, Whiteness, Blackness)LAB
generation and tests (Lightness, followed by the A-axis (green to red) and B-axis (blue to yellow))LCH
generation and tests (Lightness, Chroma, and Hue)commerce.spec.ts
tocolor.spec.ts
Add support for color gamuts: (see those supported by CSS media queries here)
space
generation and tests (color space list here)Add CSS support: (perhaps in
options
have{ format: 'css' }
)rgb(255, 0, 0)
(covers sRGB gamut for CSS)rgba(255, 0, 0, 0.5)
hsl(0deg 100% 80%)
hsl(0deg 100% 50% / 0.5)
hwb(194 0% 0%)
cmyk(100%, 0%, 0%, 0%)
lab(29.2345% 39.3825 20.0664)
lch(52.2345% 72.2 56.2)
color(display-p3 0 1 0)
Design Decisions: (WIP)
hex
andnumeric
methods and provide the option in argsbinary
as a return formatCSS Colors Reference
Modern CSS Colors