找回密码
 立即注册
查看: 78|回复: 2

[已解决] 求助,Picture-elements图标透明度的问题

[复制链接]

4

主题

11

回帖

152

积分

注册会员

积分
152
金钱
137
HASS币
0
发表于 前天 14:50 | 显示全部楼层 |阅读模式
本帖最后由 stone360 于 2025-6-12 10:39 编辑

见图,
QQ20250611-145023.png
一样的代码,为什么一开灯,上面(L1)的图标变成半透明的了,如何能让图标像下面L2那样,不要透明。原始代码如下

views:
  - theme: Backend-selected
    title: Plan
    path: plan
    icon: mdi:floor-plan
    type: panel
    badges: []
    cards:
      - type: picture-elements
        image: /local/ui/家庭总览_empty.png
        elements:
          - type: image
            entity: light.chuangmi_cn_36501732_ip449a_s_3_indicator_light
            tap_action:
              action: none
            style:
              pointer-events: none
              top: 49.7%
              left: 57.6%
              width: 84.8%
              mix-blend-mode: lighten
            state_image:
              'off': /local/ui/transparent.png
              'on': /local/ui/主卧L1.png
          - type: image
            entity: light.chuangmi_cn_36501732_ip449a_s_3_indicator_light
            tap_action:
              action: toggle
            style:
              top: 14%
              left: 76%
              width: 4%
            state_image:
              'off': /local/ui/strip_off.png
              'on': /local/ui/strip_on.png

          - type: image
            entity: light.chuangmi_cn_369501732_ip23a_s_3_indicator_light
            tap_action:
              action: none
            style:
              pointer-events: none
              top: 49.7%
              left: 57.6%
              width: 84.8%
              mix-blend-mode: lighten
            state_image:
              'off': /local/ui/transparent.png
              'on': /local/ui/主卧L2.png
          - type: image
            entity: light.chuangmi_cn_369501732_ip23a_s_3_indicator_light
            tap_action:
              action: toggle
            style:
              top: 21%
              left: 76%
              width: 4%
            state_image:
              'off': /local/ui/light_off.png
              'on': /local/ui/light_on.png



回复

使用道具 举报

10

主题

206

回帖

1906

积分

金牌会员

积分
1906
金钱
1685
HASS币
20
发表于 前天 15:26 | 显示全部楼层
是你png图标本身就是透明的,on  off状态只是替换png图标,用软件改下相应的图标文件吧
回复

使用道具 举报

4

主题

11

回帖

152

积分

注册会员

积分
152
金钱
137
HASS币
0
 楼主| 发表于 昨天 10:38 | 显示全部楼层
找到原因了,是由于两个灯的开灯效果底图重叠了,相当于下面的灯的开灯背景图盖到了上面的灯的图标,因为有 lighten的混合模式,所以上面的图标变透明了。由于没有找到好的方法,只能在ps里把开灯的效果底图提前在灯图标位置挖一个圆孔,粗暴但有效。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian ( 晋ICP备17001384号-1 )

GMT+8, 2025-6-13 18:45 , Processed in 1.150355 second(s), 25 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表