Tag: background color

背景颜色hex到JavaScriptvariables

我对JavaScript和jQuery很陌生,现在我面临一个问题: 我需要发布一些数据到PHP和一点的数据需要是div X的背景颜色hex。 jQuery有css(“background-color”)函数,并且可以将背景的RGB值转换为JavaScriptvariables。 CSS函数似乎返回像这样rgb(0,70,255)的string。 我找不到任何方式来获取hex的背景颜色(即使它在CSS中设置为hex)。 所以看来我需要将其转换。 我find了一个将RGB转换为hex的函数,但是它需要用三个不同的variablesr,g和b来调用。 所以我需要parsingstringrgb(x,xx,xxx)到var r = x; var g = xx; var b = xxx; 不知何故。 我试图谷歌parsingJavaScript的string,但我真的不明白正则expression式的东西。 有没有办法得到div的背景颜色为hex,或者可以将string转换成3个不同的variables?

如何在iOS7中更改UISearchBar的背景颜色

如何更改iOS7中的UISearchBar的背景颜色? 不是灰色的,我想改变我的uinavigationbar颜色 如果我使用这个代码,这是什么出来 searchBar.backgroundColor = [UIColor redColor]; 那不是红色! 这与导航栏的背景颜色完全相同的情况。

是否有可能只改变hover的rgba背景颜色的阿尔法?

我有一组不同的rgba背景颜色,但相同的阿尔法。 是否可以编写一个只改变rgba属性的透明度的CSS样式? 代码的一个简单例子: <a href="#"><img src="" /><div class="brown">Link 1</div></a> <a href="#"><img src="" /><div class="green">Link 2</div></a> 和风格 a {display: block; position: relative} .brown {position: absolute; bottom: 0; background-color: rgba(118,76,41,.8);} .green {position: absolute; bottom: 0; background-color: rgba(51,91,11,.8);} 我想要做的是编写一个单一的样式,当<a>hover时改变不透明度,但保持颜色不变。 就像是 a:hover .green, a:hover .brown {background-color: rgba(inherit,inherit,inherit,1);}

Sass – 将hex转换为RGBa用于背景不透明

我有以下的Sass mixin,这是对RGBa例子的一个完整的修改: @mixin background-opacity($color, $opacity: .3) { background: rgb(200, 54, 54); /* The Fallback */ background: rgba(200, 54, 54, $opacity); } 我已经申请$opacity确定,但现在我坚持与$color部分。 我将发送到mixin的颜色将是HEX而不是RGB。 我的例子使用将是: element { @include background-opacity(#333, .5); } 如何在这个mixin中使用HEX值?

如何以编程方式将文本颜色设置为文本视图

如何以文本方式将文本视图的文本颜色设置为#bdbdbd ?

在C#代码中设置WPF文本框的背景颜色

我怎样才能在c#中以编程方式更改WPF文本框的背景和前景颜色?

如何更改焦点和点击ListView项目的颜色

我有一个列表查看在我的应用程序(这是XML布局): <?xml version="1.0" encoding="utf-8"?> <ListView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/arrayList" android:layout_width="fill_parent" android:layout_height="fill_parent" android:textFilterEnabled="true" android:scrollbars="vertical" android:drawSelectorOnTop="true"> </ListView> 我的列表View中的每个项目都由两个TextView组成: <?xml version="1.0" encoding="utf-8"?> <TableLayout android:layout_width="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/row_container" android:padding="5px" android:layout_height="wrap_content" android:background="@color/white" android:shrinkColumns="0"> <TableRow> <TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_below="@+id/ description" android:id="@+id/description" android:textColor="@color/black" android:scrollHorizontally="true" android:singleLine="true"></TextView> </TableRow> <TableRow> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/result" android:textColor="@color/grey" android:maxLines="1" android:scrollHorizontally="true"></TextView> </TableRow> </TableLayout> 我从一个ArrayAdapter中填充我的listView,这样: public class Matches extends Activity { /** Called […]

如何更改JTabbedPane的背景颜色?

我知道你可以修改LaF的属性 ,但是你怎样才能做到这一点? 我只问,因为setBackground似乎没有做到这一点。 请注意,我正在更改以下属性: TabbedPane.background (或TabbedPane.contentAreaColor ?) TabbedPane.tabAreaBackground

最好的方法来更改NSView的背景颜色

我正在寻找更改NSView的backgroundColor的最佳方法。 我也想能够为NSView设置适当的alpha蒙版。 就像是: myView.backgroundColor = [NSColor colorWithCalibratedRed:0.227f green:0.251f blue:0.337 alpha:0.8]; 我注意到NSWindow有这个方法,我不是NSColorWheel或NSImage后台选项的大粉丝,但是如果他们是最好的,愿意使用。