在 Flutter 中将十六进制值转换为颜色名称
有没有办法使用flutter中的任何包将十六进制值转换为颜色名称?
is there a way to convert from Hex value to the color name using any package in flutter?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有一个名为 color_convert 1.0.2 的包应该有帮助吗?但是,它仅采用GitHub 列表上找到的颜色名称据我了解。
所以我不认为它可以用于广泛的颜色(GitHub 列表有大约 147 种 RGB 颜色,我认为可以转换为 HexCode,然后转换为文本),但你当然可以使用这个颜色转换器并进行工作来构建您自己的更具体的颜色。
截至目前,我认为没有一个软件包能够完全满足您的需求,但这是一个好的开始。
There is this package called color_convert 1.0.2 that should help? However, it only takes color names found on a GitHub list from what I understand.
So I don't think it can be used for a wide range of colors (the GitHub list has around 147 colors in RGB which I think can be converted to HexCode and then Text), but you could certainly take this color converter and work off of it to build your own for more specific colors.
As of current I don't think there is a package that does exactly what you are looking for, but this is a good start.
您可以在不使用任何软件包的情况下实现。您可以按如下方式转换十六进制颜色:
然后访问:
You can achieve without using any pacakges.You can convert hex color as follows:
Then access as: