-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
Rgb #53
Conversation
Current coverage is 100% (diff: 100%)@@ master #53 diff @@
===================================
Files 18 21 +3
Lines 73 84 +11
Methods 0 0
Messages 0 0
Branches 0 0
===================================
+ Hits 73 84 +11
Misses 0 0
Partials 0 0
|
|
||
function toHex(value) { | ||
const hex = value.toString(16) | ||
return hex.length === 1 ? `0${hex}` : hex |
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.
When is hex
ever just one character and why do we prefix 0 in that case?
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.
If you create the hex of 0 it will be '0'
. The issue here at hand is that only of 3 parts of a hex color can be reduced only then it should be. Otherwise two characters e.g. prefixed with a 0
are required.
Looks amazing, just the short hex notations and then let's 🚢 |
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.
Can you add a new heading called "Color" below mixins and add this util to .documentation.json
into the ToC and rebuild the docs? Then we can ship this!
Great to see the color portion of this underway, thanks for the contribution @nikgraf! |
The one thing missing is to reduce the hex values e.g.
#ffffff
to#fff
. I will add this sometime later.