uVeiw color 颜色值

简介: uVeiw color 颜色值

此功能为uView内部通过js提供的一些颜色值,可以用于通过js修改元素字体,背景颜色等一些场景,常用于uView的各个组件中。

这些颜色值,挂载在$u对象下的color数组中,关于这些颜色值的具体描述,详见Color 色彩

使用方法:如使用primary颜色值,方法为:$u.color['primary']

说明:这些通过JS调用的颜色值,也是能通过CSS调用的,二者等价。详见Color 色彩

#主题颜色

该主题颜色值,一共有5个,分别是primaryerrorsuccessinfowarning

export default{
  onLoad() {
    console.log(uni.$u.color['error']);
  }
}

copy

#文字颜色

uView一共提供了四个颜色值,具体请见组件部分Color色彩

分别有:mainColorcontentColortipsColorlightColorborderColor(边框颜色值)

export default{
  onLoad() {
    console.log(uni.$u.color['contentColor']);
  }
}

copy

#背景颜色

uView提供了一个浅灰的背景颜色值,该值为#f3f4f6

export default{
  onLoad() {
    console.log(uni.$u.color['bgColor']);
  }
}
相关文章
|
1月前
color - 让你的输出带点颜色
color - 让你的输出带点颜色
18 1
|
4月前
|
搜索推荐 UED
什么是计算机图形领域的 color saturation
什么是计算机图形领域的 color saturation
|
4月前
|
前端开发
背景色[background-color]
背景色[background-color]。
32 6
|
4月前
|
前端开发
前景色[color]
前景色[color]。
26 0
|
4月前
一行代码获取rgba颜色色值的透明度
一行代码获取rgba颜色色值的透明度
|
11月前
|
前端开发
COLOR
COLOR
109 0
|
算法 Windows
1054. The Dominant Color (20)
Behind the scenes in the computer's memory, color is always talked about as a series of 24 bits of information for each pixel.
1053 0