Skip to content

覆蓋顏色 ​

此配置參數允許您覆蓋當前選定 color_scheme 的預設顏色。這使您能夠根據儀表板主題和個人喜好完全自訂地圖的視覺外觀。偏好的顏色可以在 YAML 配置的 override_colors 設定中定義,該設定接受標準顏色代碼,如十六進制、RGB 及 RGBA 值。

深色模式顏色

可以通過在 override_colors 中的 dark 區塊下分組,專門為深色模式定義單獨的顏色。當 Home Assistant 儀表板使用深色主題時,這些顏色會自動優先使用。

可覆蓋的顏色:

  • floor, wall, passive_segment, new_segment, hidden_segment
  • no_go, no_go_outline, no_mop, no_mop_outline
  • virtual_wall, virtual_threshold, passable_threshold, impassable_threshold
  • ramp, ramp_outline, low_lying_area, auto_low_lying_area, manual_low_lying_area
  • curtain, split_line
  • active_area, active_area_outline, active_point, active_point_outline
  • carpet, carpet_outline, deleted_carpet, deleted_carpet_outline, detected_carpet, detected_carpet_outline
  • path, mop_path
  • icon_background, settings_background, settings_icon_background
  • text, order, text_stroke
  • obstacle_background, floor_material
  • carpet_color_selected, detected_carpet_color, carpet_color, carpet_color_deleted
  • wifi_wall, wifi_excellent, wifi_high, wifi_low, wifi_poor, wifi_unreached
  • dirty_area, clean_area, second_clean_area
  • blocked_segment, blocked_segment_overlay, blocked_segment_floor

區段顏色

在覆蓋 segment 顏色時,每個房間必須定義為兩個顏色的配對。在每對中,第一個顏色是房間的正常顏色,第二個顏色是在選擇該房間時使用的顏色。

卡片樣式

此配置僅覆蓋地圖內部繪製的顏色。如果需要覆蓋與整體卡片介面相關的顏色,請參閱 卡片樣式 部分。

YAML 範例 ​

yaml
type: custom:dreame-vacuum-card
entity: vacuum.l10s_gen2
override_colors:
  floor: 'rgba(110,110,110,1)'
  wall: 'rgba(64,64,64,1)'
  path: 'rgba(200,200,200,1)'
  active_area: 'rgba(113,189,237,0.4)'
  no_go: 'rgba(133,0,0,0.5)'
  no_mop: 'rgba(134,0,226,0.5)'
  virtual_wall: 'rgba(133,0,0,0.78)'
  carpet: 'rgba(36,163,55,1)'
  icon_background: 'rgba(50,50,50,1)'
  text: 'rgba(220,220,220,1)'
  segment:
    - - 'rgba(46,81,142,1)'
      - 'rgba(12,92,232,1)'
    - - 'rgba(130,111,38,1)'
      - 'rgba(180,146,9,1)'
    - - 'rgba(39,111,158,1)'
      - 'rgba(15,152,242,1)'
    - - 'rgba(83,104,56,1)'
      - 'rgba(76,168,63,1)'
  dark:
    floor: 'rgba(20,20,20,1)'
    wall: 'rgba(40,40,40,1)'
    path: 'rgba(255,255,255,0.8)'
    active_area: 'rgba(50,100,200,0.4)'
    no_go: 'rgba(200,0,0,0.5)'
    no_mop: 'rgba(100,0,100,0.5)'
    icon_background: 'rgba(50,50,50,1)'
    text: 'rgba(255,255,255,1)'