rgb

VBA Excel: Range of RGB for Colorindex compatibility

对着背影说爱祢 提交于 2019-12-13 03:05:50
问题 I have a macro created in Excel 2007 which lets a value depend on the font color of a source file, as follows (this piece of code is part of a loop): If Worksheets("Source1").Cells(i, j).Font.Color = RGB(165, 165, 165) Or Worksheets("Source1").Cells(i, j).Font.Color = RGB(117, 146, 60) Then Worksheets("Result").Cells(UnusedRow, 15).Value = "Closed" Else Worksheets("Result").Cells(UnusedRow, 15).Value = "Active" End If This works without a problem. However, strangely enough the same cells in

Get RGBValues of Bitmap in Android

江枫思渺然 提交于 2019-12-13 02:20:28
问题 I'm having some issues getting the RGB values of a bitmap in Android... This is what I'm doing: int[] temp = new int[width*height]; bit.getPixels(temp, 0, width, 0, 0, width, height); However, the colors don't seem to match the typical RGB values. For example, a white pixel will show up as -1, whereas the RGB value for it is 16777215. (I'm getting that value from this website: http://www.shodor.org/stella2java/rgbint.html) There's also a ton of negative values which don't seem to fit normal

Arduino and RGB LEDs

删除回忆录丶 提交于 2019-12-13 02:02:03
问题 Suppose I have an array: int rgbcolors = {{R1,G1,B1},{R2,G2,B2},{R3,G3,B3},{Rn,Gn,Bn}} How do I cycle through the values of this array by pressing 1 button on the remote? So pressing once, gives the first {R1,G1,B1}, pressing twice, gives {R2,G2,B2} etc... My current void loop for predefined colors: if (irrecv.decode(&results)) { int i = 0; int j = 0; int k = 0; unsigned int val = results.value; irrecv.resume(); switch(val) { case button1: //RED analogWrite(RedPin,255); analogWrite(GreenPin,0

Reading RGB pixels from bmp file

亡梦爱人 提交于 2019-12-13 01:02:14
问题 I have a small bmp file and I want to get the RGB values of each pixel and output those values into a txt file if R, G, and B aren't all zero. I wrote the following program; it reads the header data correctly, but the RGB values aren't coming up. I assume I did something wrong in the for loop. #include <iostream> #include <fstream> #include <cstdlib> using namespace std; int main() { ifstream ifs; ofstream ofs; char input[80]; char output[80]; cout<<"Input file name"<<endl; cin>>input; ifs

Getting the average RGB color of a CGImageRef in iOS

女生的网名这么多〃 提交于 2019-12-13 00:57:55
问题 I've been struggling with this for a couple of hours, and I'm hoping someone else has some insight. I'm looking for a way to get the average RGB color of a 1x1 UIImage. So far I've created a CGImageRef from the UIImage, but I'm really new to CoreGraphics, so I'm not sure where to go from there. Any help is appreciated. Thanks! 回答1: If you have a CGImage, you get the data by calling CGDataProviderRef CGImageGetDataProvider ( CGImageRef image ); CGImage doc Then you can copy the data CFDataRef

Python - Find the closest color to a color, from giving list of colors

☆樱花仙子☆ 提交于 2019-12-13 00:04:48
问题 I have a list of 20 colors, each is like this (0,0,0)(rgb) but with different values, and i need to find the closest to the color i am giving, for example (200, 191, 231). problem is i am not sure how i should check what color is the closes, and how am i suppose to set all these color values, in a list? in an array? I've been thinking maybe add all the color for exmaple (1,2,3) = 4 an then find the closest but i am not sure if its a good idea.. Here's a list of the colors: #(0, 0, 0) - Black

RGB values under the mouse cursor

老子叫甜甜 提交于 2019-12-12 23:19:03
问题 Using these classes : import java.awt.AWTException; import java.awt.Color; import java.awt.MouseInfo; import java.awt.Point; import java.awt.PointerInfo; import java.awt.Robot; import javax.swing.JFrame; How can i get my program to read the rgb values under my mouse while i hover over the screen and have a Jframe display the color itself. the rgb values. and possibly the name of the color 回答1: package stack; import java.awt.Color; import java.awt.MouseInfo; import java.awt.Point; import java

Multiply each pixel in an image by a factor

谁都会走 提交于 2019-12-12 19:51:34
问题 I have an image that is created by using a bayer filter and the colors are slightly off. I need to multiply RG and B of each pixel by a certain factor ( a different factor for R, G and B each) to get the correct color. I am using the python imaging library and of course writing in python. is there any way to do this efficiently? Thanks! 回答1: Here is how to do it: First split your image into the RGB channels. Use point to multiply a channel by factor ( 1.5 in the example, on the r channel).

Change values of multiple pixels in a RGB image

与世无争的帅哥 提交于 2019-12-12 18:27:08
问题 I have to change pixel values in a RGB image. I have two arrays indicating positions, so: rows_to_change = [r1, r2, r3, ..., rn]; columns_to_change = [c1, c2, c3, ..., cn]; I would operate this modification without loops. So intuitively, in order to set the red color in those location, I write: image(rows_to_change, columns_to_change, :) = [255, 0, 0]; This code line returns an error. How can I operate this change without using a double for loop? 回答1: You can use sub2ind for this, but it's

RGB颜色参考

//--> 颜色值: 实色效果 英文名称 R.G.B 16色 实色效果 英文名称 R.G.B 16色 Snow 255 250 250 #FFFAFA PaleTurquoise1 187 255 255 #BBFFFF GhostWhite 248 248 255 #F8F8FF PaleTurquoise2 174 238 238 #AEEEEE WhiteSmoke 245 245 245 #F5F5F5 PaleTurquoise3 150 205 205 #96CDCD Gainsboro 220 220 220 #DCDCDC PaleTurquoise4 102 139 139 #668B8B FloralWhite 255 250 240 #FFFAF0 CadetBlue1 152 245 255 #98F5FF OldLace 253 245 230 #FDF5E6 CadetBlue2 142 229 238 #8EE5EE Linen 250 240 230 #FAF0E6 CadetBlue3 122 197 205 #7AC5CD AntiqueWhite 250 235 215 #FAEBD7 CadetBlue4 83 134 139 #53868B PapayaWhip 255 239 213 #FFEFD5 Turquoise1 0 245