We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Any possibility / support for adding a convenience method to return the colour in hex format?
The text was updated successfully, but these errors were encountered:
No immediate plans to support this, but here’s one implementation:
function hex(value) { value = Math.max(0, Math.min(255, Math.round(value) || 0)); return (value < 16 ? "0" : "") + value.toString(16); } d3.rgb.prototype.toHexString = function() { return "#" + hex(this.r) + hex(this.g) + hex(this.b); };
Sorry, something went wrong.
Thanks, extending the prototype works fine for my case.
Add color.hex. Fixes #38.
31ff15a
No branches or pull requests
Any possibility / support for adding a convenience method to return the colour in hex format?
The text was updated successfully, but these errors were encountered: