Open matthewmayer opened 1 year ago
Just a random thought for "internet css colors" There is a finite set of all browser supported named css colors: https://www.w3schools.com/cssref/css_colors.php
without reading the code, i would never have guessed the current implementation.
TBH, I don't see a problem here. I dont think we need to change anything.
The ColorModule
obviously has a lot of different color-related functions.
The InternetModule
obviously has many different functions related to the internet.
If you now think about a color in the internet (from a dev perspective) - CSS is the first thing that comes to my mind. I may be biased since I am a frontend dev.
without reading the code, i would never have guessed the current implementation.
Good thing we have documentation, so you don't need to read the source code :)
Team Decision
We will try to merge the color function with color.rgb
as an option.
In the long run we want to deprecate the internet.color
method.
this seems logical, it could be an option for faker.color.rgb to make "nice" colors.
Also TBH if you want "nice" colors nowadays it's way easier to not use RGB but another color space like HSB or HSL, because you can fix the saturation and brightness/lightness and just change the hue, and you get nice matching colors.
this seems logical, it could be an option for faker.color.rgb to make "nice" colors.
Also TBH if you want "nice" colors nowadays it's way easier to not use RGB but another color space like HSB or HSL, because you can fix the saturation and brightness/lightness and just change the hue, and you get nice matching colors.
So you mean we can just deprecate the internet.color
at all and just suggest to switch to the color module and use a fitting method for the use case?
Not quite because the faker.color.* etc don't have a way to supply a base color. So I guess that would be needed first.
For reference, some example colors for faker.internet.color (with and without a base color) vs faker.color.rgb:
https://stackblitz.com/edit/faker-js-demo-861y3v
whether its "aethetically pleasing" is a matter of opinion :)
faker.internet.color
is a bit of an oddity in thefaker.internet
module which "Generates a random css hex color code in aesthetically pleasing color palette."Deprecate and move to...
faker.color.internet
?faker.color.rgbFromBase
?