| | |
| | | require(items[0].get("iconFrame", {}).get("width") == expected_icon_size, "non-hovered selected app icon must match normal fixture icon size") |
| | | require(items[hover_index].get("iconFrame", {}).get("width") == 68, "hovered app icon must be 68pt") |
| | | |
| | | blue_reference = next( |
| | | ( |
| | | color |
| | | for segment in segments |
| | | for color in segment.get("windowBlockColors", []) |
| | | if color.get("alpha", 0) > 0 |
| | | ), |
| | | None |
| | | ) |
| | | require(blue_reference is not None, "fixture must expose a Space Lane blue reference color") |
| | | blue_reference = {"red": 135 / 255, "green": 200 / 255, "blue": 1.0, "alpha": 1.0} |
| | | hovered_title_color = columns[hover_index].get("appNameColor", {}) |
| | | hovered_header_color = columns[hover_index].get("headerBackgroundColor", {}) |
| | | hovered_count_color = columns[hover_index].get("countColor", {}) |
| | | for channel in ("red", "green", "blue"): |
| | | require( |
| | | abs(hovered_title_color.get(channel, -1) - blue_reference.get(channel, -2)) <= 0.002, |
| | | f"hovered column title must use the same blue reference for {channel}" |
| | | abs(hovered_header_color.get(channel, -1) - blue_reference.get(channel, -2)) <= 0.002, |
| | | f"hovered column header must use #87C8FF for {channel}" |
| | | ) |
| | | require(hovered_title_color.get("alpha", 0) >= 0.98, "hovered column title color must be opaque") |
| | | require(hovered_header_color.get("alpha", 0) >= 0.98, "hovered column header blue fill must be opaque") |
| | | for color_name, color in (("title", hovered_title_color), ("count", hovered_count_color)): |
| | | for channel in ("red", "green", "blue", "alpha"): |
| | | require(abs(color.get(channel, -1) - 1.0) <= 0.002, f"hovered column {color_name} text must be pure white for {channel}") |
| | | for index, column in enumerate(columns): |
| | | if index == hover_index: |
| | | continue |
| | | require(column.get("isHovered") is False, "non-hovered columns must not be marked hovered") |
| | | require("hover" not in column.get("visualStates", []), "non-hovered columns must not expose hover visual state") |
| | | normal_header = column.get("headerBackgroundColor", {}) |
| | | require( |
| | | any(abs(normal_header.get(channel, -1) - blue_reference[channel]) > 0.05 for channel in ("red", "green", "blue")), |
| | | "non-hovered column headers must not use the hover blue fill" |
| | | ) |
| | | |
| | | normal_items = [ |
| | | item for item in items |
| | |
| | | "selectedIcon": items[0].get("iconFrame"), |
| | | "hoveredIndex": root.get("appShelfHoveredIndex"), |
| | | "hoveredIcon": items[hover_index].get("iconFrame"), |
| | | "hoveredColumnHeaderColor": hovered_header_color, |
| | | "hoveredColumnTitleColor": hovered_title_color, |
| | | "hoveredColumnCountColor": hovered_count_color, |
| | | "blueReference": blue_reference, |
| | | "selectedZ": selected_z, |
| | | "hoverZ": hover_z, |