色彩 
Ucs Design 的设计团队采用 Arco 色彩模型进行设计,该模型更便于设计师在调整色彩时对于颜色有明确的心理预期,同时也方便团队间的沟通。
主题色 
主题
primary
#604CFC
辅助色 
成功
success
#07C160
警告
warning
#EDA20C
危险
danger
#D9514C
中性色 
grey-1
#ffffff
grey-2
#f7f8fa
grey-3
#f2f3f5
grey-4
#e5e6eb
grey-5
#c9cdd4
grey-6
#a9aeb8
grey-7
#86909c
grey-8
#6b7785
grey-9
#4e5969
grey-10
#272e3b
grey-11
#1d2129
grey-12
#141414
内置色彩 
Red / 浪漫红
red
#F53F3F
Orange Red / 晚秋红
orangered
#F77234
Orange / 活力橙
orange
#FF7D00
Gold / 黄昏
gold
#F7BA1E
Yellow / 柠檬黄
yellow
#FADC19
Lime / 新生绿
lime
#9FDB1D
Green / 仙野绿
green
#00B42A
Cyan / 碧涛青
cyan
#14C9C9
Blue / 海蔚蓝
blue
#3491FA
Arco Blue / 极致蓝
arcoblue
#165DFF
Purple / 暗夜紫
purple
#722ED1
Pink Purple / 青春紫
pinkpurple
#D91AD9
Magenta / 品红
magenta
#F5319D
获取色彩API 
温馨提示
使用 UCS 色彩变量,切换暗黑模式时则自动变更为深色颜色值。
getOsColor(options) 
获取 Ucs Design 色彩模型内置色彩
options 
| 参数名称 | 类型 | 必填 | 可选值 | 描述 | 
|---|---|---|---|---|
| color | string | 是 | - | UCS 色彩变量 或 hex颜色值 | 
使用演示 
ts
<script setup>
	import { getOsColor } from "@/uni_modules/ucs-config"; 
	/**
	 * 使用 UCS 色彩变量
	 * 浅色模式下获取值为:#604CFC
	 * 深色模式下获取值为:#8772FD
	 */
	console.log(getOsColor("primary")) 
	
	/**
	 * 使用 hex 颜色值
	 * 获取值为:#1890ff
	 */
	console.log(getOsColor("#1890ff")) 
</script>vue
<template>
	<view>
	<!-- 使用内置色彩变量 -->
	<!-- 浅色模式下获取值为:#604CFC -->
	<!-- 深色模式下获取值为:#8772FD -->
	{{getOsColor("primary")}}
</view>
</template>
<script setup>
	import { getOsColor } from "@/uni_modules/ucs-config"; 
</script>getOsTextColor(options) 
获取文本颜色
options 
| 参数名称 | 类型 | 必填 | 可选值 | 描述 | 
|---|---|---|---|---|
| color | string | 是 | 色彩 | UCS 色彩变量 或 Hex 颜色值 | 
vue
<template>
	<text :style="[getOsTextColor('primary')]">
		欢迎使用 ucs-design 设计
	</text>
</template>
<script setup>
	import { getOsTextColor } from "@/uni_modules/ucs-config"; 
</script>
<style>
	
</style>vue
<template>
	<text :style="[getOsTextColor('#604CFC')]">
		欢迎使用 ucs-design 设计
	</text>
</template>
<script setup>
	import { getOsTextColor } from "@/uni_modules/ucs-config"; 
</script>
<style>
	
</style>getOsBackground(options) 
获取背景颜色
options 
| 参数名称 | 类型 | 必填 | 可选值 | 描述 | 
|---|---|---|---|---|
| color | string | 是 | 色彩 | UCS 色彩变量 或 Hex 颜色值 | 
vue
<template>
	<view class="box" :style="[getOsBackground('primary')]">
	</view>
</template>
<script setup>
	import { getOsBackground } from "@/uni_modules/ucs-config"; 
</script>
<style>
	.box {
		width: 100%;
		height: 123px;
	}
</style>vue
<template>
	<view class="box" :style="[getOsBackground('#604CFC')]">
	</view>
</template>
<script setup>
	import { getOsBackground } from "@/uni_modules/ucs-config"; 
</script>
<style>
	.box {
		width: 100%;
		height: 123px;
	}
</style>getOsGradient(options) 
获取渐变背景颜色
options 
| 参数名称 | 类型 | 必填 | 可选值 | 描述 | 
|---|---|---|---|---|
| direction | string | 是 | direction 渐变方向 | 渐变方向 | 
| colorStart | string | 是 | 色彩 | UCS 色彩变量 或 Hex 颜色值 | 
| colorStop | string | 是 | 色彩 | UCS 色彩变量 或 Hex 颜色值 | 
direction 渐变方向 
| 参数值 | 描述 | 
|---|---|
| to right | 从左向右渐变 | 
| to left | 从右向左渐变 | 
| to bottom | 从上到下渐变 | 
| to top | 从下到上渐变 | 
| to bottom left | 从右上角到左下角(3.99开始支持) | 
| to bottom right | 从左上角到右下角 | 
| to top left | 从右下角到左上角 | 
| to top right | 从左下角到右上角(3.99开始支持) | 
vue
<template>
	<view class="box" :style="[getOsGradient('to right','primary','success')]">
	</view>
</template>
<script setup>
	import { getOsGradient } from "@/uni_modules/ucs-config"; 
</script>
<style>
	.box {
		width: 100%;
		height: 123px;
	}
</style>vue
<template>
	<view class="box" :style="[getOsGradient('to right','#604CFC','#07C160')]">
	</view>
</template>
<script setup>
	import { getOsGradient } from "@/uni_modules/ucs-config"; 
</script>
<style>
	.box {
		width: 100%;
		height: 123px;
	}
</style>getOsBorder(options) 
获取右边框属性
options 参数 
| 参数名称 | 类型 | 必填 | 可选值 | 描述 | 
|---|---|---|---|---|
| direction | string | 是 | direction 边框方向 | 边框方向 | 
| width | string | 是 | - | 边框宽度 | 
| style | string | 是 | solid、dashed、dotted | 边框样式 | 
| color | string | 是 | 色彩 | UCS 色彩变量 或 Hex 颜色值 | 
direction 边框方向 
| 参数值 | 描述 | 
|---|---|
| all | 全边框(四边) | 
| top | 上边框 | 
| bottom | 下边框 | 
| left | 左边框 | 
| right | 右边框 | 
边框样式 
| 参数值 | 描述 | 
|---|---|
| none | 和关键字 hidden 类似,不显示边框。在这种情况下,如果没有设定背景图片,border-width 计算后的值将是 0,即使先前已经指定过它的值。在单元格边框重叠情况下,none 值优先级最低,意味着如果存在其他的重叠边框,则会显示为那个边框。 | 
| solid | 显示为一条实线 | 
| dashed | 显示为一系列短的方形虚线。标准中没有定义线段的长度和大小,视不同实现而定 | 
| dotted | 显示为一系列圆点。标准中没有定义两点之间的间隔大小,视不同实现而定。圆点半径是 border-width 计算值的一半 | 
vue
<template>
	<view class="box" :style="[getOsBorder('all','2px','dotted','primary')]">
	</view>
</template>
<script setup>
	import { getOsBorder } from "@/uni_modules/ucs-config"; 
</script>
<style>
	.box {
		width: 123px;
		height: 123px;
	}
</style>vue
<template>
	<view class="box" :style="[getOsBorder('all','2px','dotted','#604CFC')]">
	</view>
</template>
<script setup>
	import { getOsBorder } from "@/uni_modules/ucs-config"; 
</script>
<style>
	.box {
		width: 123px;
		height: 123px;
	}
</style>