我使用的离子4 fab按钮,在fab按钮,我想设置一个动态背景颜色。
下面是示例代码:
page.html
<!-- fab placed to the bottom end -->
<ion-fab vertical="bottom" horizontal="end" slot="fixed">
<ion-fab-button [style.background.color]="currentColor" [style.color]="isColorLight(currentColo
我有一张照片,由手机的摄像头拍摄,结果就像http://localhost:8080/var/mobile/Containers/Data/Application/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/tmp/cdv_photo_001.jpg一样。
无论我尝试什么,我都无法让它为给定的div设置背景图像。(在该div上使用内联CSS )。
So: <div style="background: url('{{ imageUrl }}');">不工作( div有高度和宽度,当我将背景放置到yellow时,会看到黄色
我有过
<span [ngStyle]="{'background-color': dynamicColor}">ABC</span>
我想要设置字体颜色的文本,根据背景颜色,即倒置颜色的background-color,以便易于阅读。就像如果background-color是白色的,那么文本的颜色应该是黑色的。如果background-color是黑色的,那么文本的颜色就是白色。
在sass中,我可以使用以下函数轻松地完成这一任务
// function to return the text-color based on the pas