yzsp-studio/mediakit-shared-suite / ppt
ppt
Unverified飞书幻灯片:创建和编辑幻灯片。创建演示文稿、读取幻灯片内容、管理幻灯片页面(创建、删除、读取、局部替换)。当用户需要创建或编辑幻灯片、读取或修改单个页面时使用。
scripts/svg_relation_lib/attributes/highlight.py
View on GitHub"""
A8 · Highlight attribute · boolean spotlight
字段:highlight (bool)
默认视觉通道:opacity_inverse (非高亮 dim 到 0.35)
备用通道:accent_color
"""
from __future__ import annotations
from dataclasses import dataclass
from typing import Optional, Tuple
_ACCENT_COLOR = "#f97316" # orange-500
_DIM_COLOR = "#cbd5e1" # slate-300
@dataclass
class Highlight:
"""Highlight attribute · 高亮聚焦。"""
field_name: str = "highlight"
v1_aliases: Tuple[str, ...] = ("focus", "emphasized", "starred")
channel: str = "opacity_inverse"
fallback_channel: str = "accent_color"
def resolve_value(self, element: dict) -> Optional[bool]:
for name in (self.field_name,) + tuple(self.v1_aliases):
if name in element and element[name] is not None:
v = element[name]
if isinstance(v, bool):
return v
s = str(v).strip().lower()
if s in ("true", "1", "yes", "y", "on"):
return True
if s in ("false", "0", "no", "n", "off", ""):
return False
return None
def encode(self, value: bool, channel: str, palette=None) -> dict:
if channel == "opacity_inverse":
# 高亮 → 1.0;非高亮 → 0.35
return {"opacity": 1.0 if value else 0.35}
if channel == "accent_color":
if value:
return {"stroke": _ACCENT_COLOR, "fill": _ACCENT_COLOR, "stroke-width": 3}
return {"stroke": _DIM_COLOR, "fill": _DIM_COLOR}
return {}
DEFAULT_HIGHLIGHT = Highlight()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |