【更新】Semantic Color Palette 1.1.1色彩管理系统
This package provides a semantic color management system for Unity.
The best way to get a glimpse of the system in action is trying the online demo, but the videos work too!
So, what is semantic color management?
Basically, you define a set of meaningful identifiers for colors, representing where/how each color is used (e.g. "buttonBackground"), and not the colors themselves (e.g. "darkBrown").
Then, elsewhere, you map each idenfier to an actual color value.
The elements where colors are to be applied never directly refer to actual, specific colors, but only to semantic color ids.
This decoupling allows to quickly and flawlessly change colors to multiple elements in a centralized way, and to easily implement some form of "color skinning" by applying different id -> color mappings.
How does this system work in practice?
There are three core elements that work together to achieve its design goals:
Palette: a named set of id -> color mappings. It is a "data" element, usually persistent.
Palette provider: an active element, living in a Unity scene, that acts as a broker between palettes and colorers, pushing color updates to any relevant colorers.
Colorer: an active element that contains the logic to apply one or more colors to a scene component (UI elements, 3D models materials and more). A colorer must be connected to a palette provider, from which it retrieves colors for the color identifiers specified in its configuration.
Ready to use Colorers for Unity components using color properties (UI elements, Materials etc) are included. That said, programmers can easily extend the system with additional custom colorers (and providers).
You can improve your workflow with a new, more reasonable way to setup colors in Unity, with low friction and no compromises on your project organization.
Anything can be done through the inspector if you want, but it's also easy to use the system through code only if you prefer.
Palettes can be imported from commonly used third party formats and edited in the inspector, and in more advanced scenarios can be loaded at runtime from external files.
The asset contents are laid out to be easily packaged for use in the Package Manager, if you want to easily import it (maybe including your own customizations) from multiple projects.
该软件包为 Unity 提供了一个语义色彩管理系统。
了解系统运行情况的最佳方式是尝试在线演示,但视频也可以!
那么,什么是语义色彩管理呢?
基本上,您要为颜色定义一组有意义的标识符,代表每种颜色的使用位置和方式(例如 "buttonBackground"),而不是颜色本身(例如 "darkBrown")。
然后,在其他地方将每个标识符映射到实际的颜色值。
要应用颜色的元素永远不会直接引用实际的特定颜色,而只会引用语义上的颜色 id。
这种解耦允许以集中的方式快速、完美地更改多个元素的颜色,并通过应用不同的 id -> 颜色映射,轻松实现某种形式的 "颜色换肤"。
这个系统是如何实际运作的?
有三个核心元素共同实现其设计目标:
调色板:一组已命名的 ID -> 颜色映射。它是一个 "数据 "元素,通常是持久的。
调色板提供者:存在于 Unity 场景中的活动元素,它充当调色板和调色器之间的中介,将颜色更新推送给任何相关的调色器。
着色器:一种活动元素,包含将一种或多种颜色应用到场景组件(用户界面元素、三维模型材质等)的逻辑。着色器必须连接到调色板提供程序,从中获取其配置中指定的颜色标识符的颜色。
使用颜色属性(用户界面元素、材质等)的 Unity 组件都包含了现成可用的调色板。尽管如此,程序员仍可使用其他自定义调色板(和提供程序)轻松扩展系统。
您可以通过一种新的、更合理的方式在 Unity 中设置颜色,从而改善工作流程,减少摩擦,并且不会影响您的项目组织。
任何事情都可以通过检查器完成,但如果您愿意,也可以只通过代码轻松使用该系统。
调色板可以从常用的第三方格式导入并在检查器中编辑,在更高级的情况下,还可以在运行时从外部文件加载。
如果你想从多个项目中轻松导入资产(可能包括你自己的定制),资产内容的布局很容易打包,以便在打包管理器中使用。
页:
[1]