angular - Ngx-color-picker 从输入中隐藏颜色值
问题描述
我正在使用这个颜色选择器来允许用户设置他的颜色。
有什么办法可以隐藏输入中的十六进制值而只保留背景颜色?
如果有更好的选择,我想避免使用 CSS
<input class="form-control"
name="textSearchColor"
[(colorPicker)]="textSearchColor"
[style.background]="textSearchColor"
[(ngModel)]="textSearchColor"
/>
解决方案
我知道这有点晚了,但我想添加一个解决方案。只需将输入文本的颜色与背景颜色相同。
<input class="form-control"
name="textSearchColor"
[(colorPicker)]="textSearchColor"
[style.background]="textSearchColor"
[style.color]="textSearchColor" <----
[(ngModel)]="textSearchColor"
/>
推荐阅读
- python - 如何将误差线添加到分组条形图中?
- import - 导入的 Python 文件在正文或任何主函数中没有任何代码运行。我该如何操作这个文件?
- azure-data-factory - 从 ADF 触发 Azure ML 工作区中的 Jupyter Notebook
- python - Google Foobar - 请通过编码消息测试用例失败
- python - 交换变量与使用索引交换数组元素
- reactjs - VS Code React 应用程序使用 Chrome 调试器关闭/崩溃
- discord.py - 如何让你的机器人在加入服务器前请求权限 discord.py
- javascript - 自适应卡片在提交中输入值
- python - 二维数组中的偶数池化
- sqlite - Node-Red 无法打开 SQLite 数据库