Click here to Skip to main content
15,887,485 members
Everything / Color

Color

color

Great Reads

by Bjørn
Editing GIF colors without touching the image data within
by Chris Maunder
A quick overview and a simple Windows CMD script to make your terminal output a little more lively
by Chris Maunder
A quick overview and a simple bash script to make your script output a little more lively
by dynamichael
Build an oct-tree from a color palette for a fast nearest color search

Latest Articles

by ToughDev
More about ST7735 1.8-inch 128×160 Color LCD on a PIC Microcontroller
by PascalLandau
In the fifth part of this tutorial series on developing PHP on Docker we will setup some PHP code quality tools and provide a convenient way to control them via GNU make.
by Chris Maunder
A quick overview and a simple Windows CMD script to make your terminal output a little more lively
by Chris Maunder
A quick overview and a simple bash script to make your script output a little more lively

All Articles

Sort by Score

Color 

10 Nov 2018 by Bjørn
Editing GIF colors without touching the image data within
7 Apr 2022 by Chris Maunder
A quick overview and a simple Windows CMD script to make your terminal output a little more lively
3 Apr 2012 by Alan N
There is something odd about the ForeColor property of a read only System.Windows.Form.TextBox which I haven't seen documented, although I haven't looked very hard.I've noticed that a foreground colour change only takes effect after the background colour has been changed once. After that...
7 Apr 2022 by Chris Maunder
A quick overview and a simple bash script to make your script output a little more lively
3 Apr 2012 by OriginalGriff
You can't, without a lot of work.When you set the textbox to readonly, the foreground and background colours are overridden and ignored in favour of the system disabled colors - and it is a BAAAAD idea to change them.The easiest way to do it would be to create your own control, derived...
25 May 2019 by dynamichael
Build an oct-tree from a color palette for a fast nearest color search
24 Feb 2022 by Shmuel Zang
Simple Java helper class to print colored text in console window.
17 Aug 2013 by adriancs
An Office 2010 Style Color Picker for .NET WinForm.
7 Mar 2011 by Henry Minute
SystemColor is a subset of all colors, used by the system. e.g. Control, ControlDark, Highlight etc.KnownColor is the subset of possible colors that have been given names by Microsoft for use in VS, IE etc.NamedColor was originally the colors given names in Unix X11 but is now the same as...
20 Aug 2012 by Kenneth Haugland
Use Brushes.White instead.http://msdn.microsoft.com/en-us/library/system.windows.media.brushes.aspx[^]
12 Jul 2012 by Volynsky Alex
Please see here:http://blogs.microsoft.co.il/blogs/arik/archive/2011/06/16/ribbon-with-c-part-5-using-galleries-with-windows-ribbon-framework.aspx[^]and here:http://10rem.net/blog/2010/03/25/your-first-mfc-cplusplus-ribbon-application-with-visual-studio-2010[^]
15 Jul 2012 by Douglas Smallish
Demonstrates how to code a Silverlight Chart ControlTemplate Programmatically.
2 Dec 2012 by Simon_Whale
I would have a read of this Codeproject article is shows how to change the colour of the tabs.A .NET Flat TabControl (CustomDraw)[^]
26 May 2020 by Richard MacCutchan
int timerValue = controller.Read("mw64"); if (timerValue > 0) actvalueL1.Text = timerValue.ToString(); else actvalueL1.Text = "Test in Stand by";
19 Nov 2021 by
Image class which contains an array of unique colors with counts used to sort by color and find duplicates.
11 Dec 2010 by Rajitha Wimalasooriya
You can use the Javascript setTimeout() function.Implement a new finction using the setTimeout() function.function goDimAfterTimeout(){ setTimeout("goDim('groovyform','groovybtn1')", 10000);}And call it in the OnClick event.
16 Apr 2011 by Fabio V Silva
You're using the same geometry object for all the Path objects, the last one will stay on top of the others and you will only see that one which is making you think that all the Path are using the same colour.
18 Sep 2011 by Sergey Alexandrovich Kryukov
Using palettes or Indexed color scheme is pretty exotic these days where most of graphic cards, printers and other devices nicely render full pixel formats of 24 bits per pixel or more. So, I'm curious why you may need it. Are you sure you really need it?If you really need to improve...
21 Oct 2011 by Ray Radin
You can handle WM_NCPAINT and paint the frame yourself.
15 Feb 2012 by Jeevitha royapathi
using System.Drawing; Color colorName = System.Drawing.ColorTranslator.FromHtml("#eeee");lbdetail.BackColor = colorName;this code is working fine for me..try it..don forget to give proper hexadecimal colors :)happy coding....
15 Feb 2012 by Sergey Alexandrovich Kryukov
I see no signs of the code trying to change the color, so no wonder the color is not changing. :-)—SA
28 Sep 2021 by nbtthief
I want to create a toolbar like color picker tool in paint window 7, But i dont know how to draw image (at least a fill rect shape) on button?You can see how button Color 1 and Color 2 in paint window 7 working, i have a solution to imitate it, i use SetImageIndex() to change button image,...
1 Aug 2012 by Richard MacCutchan
Just check the documentation for the control's properties. In this case you can use the ForeColor[^] to set it to what you want.
18 Dec 2012 by Jibesh
use the same Instance second time. do not create new instance each time you display the color dialog.If you want to clear the selection, call the selection method of ColorDialog.
16 Feb 2013 by Abhinav S
Color comparison can never be very accurate since there are a number of factors like capability of the scanner to capture brightness, the surrounding light etc involved. You also have factors like alpha correction etc, which although calculable, can make the calculations quite complex.An...
16 Feb 2013 by Mike-MadBadger
To my knowledge there is no built-in component to do that.You would have to compare the encoding of the colour at a given point in the test image and find the same colour in an array of the colours in the standard.You might want to look at, Manipulating colors in .NET - Part 1[^], it's not...
17 Feb 2013 by gggustafson
In an article I wrote [^], there is a section on color difference equations. I think the Delta E 2000 equation may be helpful.
22 Mar 2013 by Dheeraj Singh Bhadoria
This Artical shows that how we can change the color of any image throw Bitmap
6 Apr 2013 by Pallavi Waikar
add DataBindingComplete event of dataGridView1 to change color..to know more about DataBindingComplete event of dataGridView check following linkhttp://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.databindingcomplete.aspx[^]try this codeprivate void LoadData() ...
24 Jul 2013 by Winston Madiano
You can use DatagridviewCellFormating Event if you want to change the back color of you datagridview row based on cell value.Ex:On your DataGridView1_CellFormatting EventDim row As DataGridViewRow = DataGridView1.Rows(e.RowIndex)Dim obj As Object = row.Cells("ColumnName").Value...
28 Jan 2014 by YvesDaoust
Set a Panel object on the form. In the OnPaint event handler of the panel, you will draw the matrix as a tiling of squares of the desired colors. Use the Graphics::FillRectangle method, passing it a SolidBrush.Alternatively, if you want the values to appear too, you can create arrays of...
22 Apr 2014 by OriginalGriff
No, this is your homework, and you are expected to do it yourself, not get marked on what we do! :laugh:Drawing in Winforms is easy: just handle the Paint event for a Form or Panel, and use the supplied Graphics context.For example, this will draw a Green Rectangle overlapping a Red...
12 Jun 2014 by CPallini
See, for instance: "Generating gradients programmatically?" at Stack Overflow[^].
13 Jun 2014 by Sergey Alexandrovich Kryukov
You are not getting it. "Color specification" it totally irrelevant to it. You images are really different: motion, lighting, noise, and so on. One second is huge time to make images very difficult on a pixel level. Even nearest frames (no matter what your frame rate is) will be very different...
3 Sep 2016 by BillWoodruff
You can set the (entire) Row BackColor or ForeColor directly:YourRow.DefaultCellStyle.ForeColor = Color.Red;You can set a particular Cell's colors by:YourCell.Style.ForeColor = Color.Red;This thread on StackOverFlow contains a number of valuable examples of working with DataGridView Color...
5 Jan 2017 by Peter Leow
They seemed contradictory:Quote:change RGB colors to their oppositesQuote:look at a color wheel to see if I was able to move the pixel's color a third of the wheelIt the title is correct, then isn't it just a matter of:newR = 255 - oldRnewG = 255 - oldGnewB = 255 - oldBregardless of...
6 Jul 2017 by RickZeeland
Use JQuery MiniColors Plugin: GitHub - claviska/jquery-minicolors: jQuery MiniColors Plugin[^]
5 Sep 2017 by CPallini
It looks that OpenCV actually use BGR: Why does OpenCV use BGR color format ? | Learn OpenCV[^]. The linked page offers insight on historical reasons behind design choices.
16 Dec 2018 by RickZeeland
See answers here: How can I change the background color of a button WinAPI C++ - Stack Overflow[^] And here: how to change color of button in vc++ mfc for vs2008[^] Also see online tutorial here: MFC Button[^]
29 Jan 2019 by User 11060979
I'm not sure what your problem exactly is, a.) OpenGL? b.) Calculations? From your question I see you recognized how to come from 3D- XYZ Space to xy(Y) space. Anyway: Here you will find a set of formulas from convert from Spectrum to XYZ on from there to xyY, sRGB, etc. and vice versa (of...
30 May 2020 by RickZeeland
Maybe this will be helpful: A Simple - Yet Quite Powerful - Palette Quantizer in C#[^]
6 Oct 2020 by Sandeep Mewara
If I understand correct, you seek to highlight some text while sending an email. For highlighting text via some color, you would need to use HTML or RTF format of text. This would enable you to have text formatting that can be sent in an email....
18 Aug 2021 by Richard Deeming
Generate a random number between 65280 (0x00ff00) and 16711680 (0xff0000). Math.random() - JavaScript | MDN[^] function getRandomInt(min, max) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min) +...
2 Dec 2012 by marcel zol
I have sent an app to my colleagues and they have win7, stlye in win is set to aero stlyle. They see all tabpage-s white even though I see in gray, color is by default "Control". If i try this code: tabControl3.TabPages[0].BackColor = Color.Green;i get the tabpage green, but the...
18 Jan 2016 by HobbyProggy
Currently you are setting the color for the DataGridView to red.If you just want a specific row you have to set the color for this row.Just like this: myrow.defaultcellstyle.forecolor="Color.Red";BTW. just to improve your code a bit, why do you set a outside of the loop?This...
2 Oct 2023 by Graeme_Grant
This is a common question with many answers on the internet. A simple Google search will give you many solutions: winform datagridview cell background color - Google Search[^]. Also there are related questions with solutions to the right of this...
22 Feb 2010 by h_kahrizy
in the name of GodhiI want to change Highlight Select Color in TextBoxHow do it?Pic Of My needThanks
5 Mar 2010 by gmculp
I am writing a recoloring algorithm which is based on the number of distinct colors in an image. How would I go about "querying" the Color Remap array to provide this information? I feel like using the Linq Distinct Extension Method may cause performance issues. Many thanks.
10 Mar 2010 by DaveAuld
You have given very little to go on to allow someone to answer.You need to be very specific in your request and be clear on what exactly the issue you are seeing is.
10 Mar 2010 by Smithers-Jones
You will totally fail your project, if you write your documentation like you phrased your "question". Are you not able to write full words?That should be enough help regarding "dat" project.
17 Mar 2010 by dharshinicpriya
hello everyone.. I have just started learning vc++ and mfc. Im creating a simple project with Dialogbar. my question is how to set background color for the dialogbar. Plz help me out of this. thanks in advance.
17 Mar 2010 by Eugen Podsypalnikov
You could implement a reaction on WM_ERASEBKGND for your bar :) :...BEGIN_MESSAGE_MAP(CYourBar, CYouBarBase) ON_WM_ERASEBKGND()...END_MESSAGE_MAP() BOOL CYourBar::OnEraseBkgnd(CDC* pDC){ CRect cClientRect; GetClientRect(cClientRect); pDC->FillSolidRect(cClientRect,...
14 May 2010 by DaveAuld
You have basically written the rules above.You want a matrix of cells, you will need to know what cell you have selected, and then analyze the cells around for valid moves.Nobody will just write code for you, you will need to start yourself and when get stuck on a problem come back and...
29 May 2010 by Moreno Airoldi
Well if you must do many searches, I guess you can consider iterating through the array, finding the best match for each pixel, and storing it.This will sure take some time ( O(n2) ), but once it's done all queries will take no time at all. :)
29 May 2010 by AspDotNetDev
Excellent question. I believe I have an answer for you.Sort the pixels into 3 lists. Each list would be sorted by the color intensity of a color component (red, green, or blue). Now, make a grid and set each point to store information about where in the 3 arrays that pixel is located. The...
29 May 2010 by AspDotNetDev
Just to add to my previous answer, I thought of another optimization. In each of the 3 lists, you could store sublists. Say you have 10 pixels that have a red value of 0. Then redList[0] would contain a list of those pixels sorted accorded to their green values. So, redList[0][1] would store a...
30 May 2010 by AspDotNetDev
One more thing to optimize my previous suggestion. If you travel 1 color value at a time in all 3 lists at once, then you can keep track of how far you've travelled in the other lists to know what the best possible minimum color you could achieve is. That way, you can use that as an exit...
1 Jul 2010 by kamalilam
is it possible to define Colorref like this???const COLORREF CYAN = RGB(0,245,255);# define CYAN 4In This Code It Will Not Be Take effect..But I can't get Able to Display The color in view... Can u help Me ..how to Solve this...??
1 Jul 2010 by CPallini
Not sure I got you, anyway, you may do something like:enum { WHITE, CYAN, ... COLORS};COLORREF color[COLORS];color[WHITE]=RGB(255,255,255);color[CYAN]=RGB(0,254, 255);... :)
17 Jul 2010 by JF2015
Hi,your main problem will be the pattern recognition. Depending on what you are trying the recognize in an image this can be quite tricky and there are lots of libraries out there that will do this job for you but are very expensive.- Cognex www.cognex.com- National Instruments:...
18 Jul 2010 by btap_644
Hi, I was going through the bitmapmixer sample in dshownet samples folder and I noticed that drawing on the video is done by alphabitmap and colorkey bitmap. I would like to know what these are ? what is the difference between them ?Many Thanks
17 Jul 2010 by btap_644
Hi, this is what I am doing, I take the input from a web camera onto a picturebox in C# and draw a rectangle on the video using a mouse. Then I plan to track that particular area(e.g. right eye)enclosed by the rectangle, as the video streams, for instance if the person moves to the right, the...
18 Jul 2010 by GPUToaster™
Follow this article: Rendering Textures with Alpha Channels and Color Key Transparency using a MatrixStack in Managed Direct3D[^]
26 Aug 2010 by norrisMiou
Hi !Currently, I'm trying to compute colors interpolation with a simple linear interpolation method, but I have a "capacity overshooting" issue when I manipulate those numbers. I'm not very good at maths, but I understand that when I make my calculations, I overshoot the max value of...
26 Aug 2010 by Christian Graus
Does this work ? In C# you need to divide by a float ( 255.0 ) to get a float value. Then you need to decide, do you scale all your values, so if you have a value of 2.0, any 1.0 becomes .5 so they stay in proportion, or do you just say if R > 1.0, R = 1.0.Your English is just fine.
27 Aug 2010 by norrisMiou
Hi Christian and thanksThen you need to decide, do you scale all your values, so if you have a value of 2.0, any 1.0 becomes .5 so they stay in proportionYes, all values need to be in proportion. I think this part is easy as I know minimum and maximum values (0-255).Does this work ?...
3 Oct 2010 by RK Verma
Hi,What should be the CMYK for Silver color.Cheers!
3 Oct 2010 by Ankur\m/
That would depend as you may have different shades for Silver.I would suggest you to download tools like Color Picker (Search Google for the links). You can get both RGB and CMYK values of the selected color.BTW, For silver try, C: 0%Y: 0%M: 0%K: 25%Hope this helps!
9 Jan 2011 by kutbidin
I am working on a project that needs to run normally on Mac Os. I have a problem with using the system color selection dialog in my website to let the client freely select a color he wants. This website is programmed with jSP, and I use JavaScript for the client behavior. Can anyone shed...
9 Jan 2011 by kutbidin
why there is no one to answer this ?
2 Feb 2011 by Babak.B
:) fasttour
16 Feb 2011 by Albin Abel
Hi,There are many ways to achieve this.1) The best way would be using a clustering algorithm with a maximum likelihood function. On the result of it each pixel will have a cluster membership. So in your subsequent search's you only need to search within the cluster members, not all the...
25 Apr 2011 by sudheer muhammed
You can use tooltip and bind the RGB values as tooltip text .Can you tell which control is used for displaying the color ?
25 Apr 2011 by Abhinav S
This[^] might be possible using the WriteableBitmap class.
3 Jun 2011 by Anshul R
Use WPF. Set ForeColor Property.
21 Oct 2011 by mardul
Hello,how can i set the colors of a popup menu on windows. I know how to set the background color via MENUINFO hbrBack and how to ownerdraw the items, but i can't find out how to set the frame color. The popup menu frame is light which looks awful in my app that has very dark colors. I've...
5 Feb 2012 by saboor awan
WP7 FloodFill in Texture2D using Scan line Stack Algo
30 Jan 2012 by Georg Machacek
HAllo,I would like to color single valuepaths in a treeview.So that my users see where to navigate.Any idea?thxGeorg
7 Feb 2012 by no_-_namee
Hi,I have a combobox which I listed colors as below;Type colorType = typeof(Colors);PropertyInfo[] propInfoList = colorType.GetProperties(BindingFlags.Static | BindingFlags.DeclaredOnly | BindingFlags.Public);foreach (PropertyInfo c in propInfoList){ ...
7 Feb 2012 by Christian Graus
ToString() will surely work ?
15 Feb 2012 by JawadHafiz
I want to have Gray background, i tried with diffrent ways but did'nt work.using System.Drawing;////lbdetail.BackColor = System.Drawing.Color.Red;How can I Use Custom color code like " #eee ".
10 Feb 2012 by namaskaaar
Include a namespaceusing System.Drawing;and whenever you want to change the color writelabel1.backcolor=color.red;if want to change the color when the form loads then you can write the code in public form1(){InitializeComponent();label1.backcolor=color.red;}orforms load...
10 Feb 2012 by Ankur\m/
JawadHafiz wrote:i am using on webform, I tried but did'nt workTry this - lbdetail.ForeColor = System.Drawing.Color.Red;
15 Feb 2012 by code_az
Hi, I have the following code for a text displayed in excel cell. Pass_indicator
1 May 2012 by Kschuler
You posted a lot of code and a lot of it really wasn't relevant. Next time you post a question, please narrow it down to just what you are having trouble with.Somewhere in that code block you are looping through each row in the data grid...Right around this bit:'...Do While nRowPos
28 May 2012 by Neelam J Gore
Hello,I am working on windows application. In that I want to change color of all labels at runtime on all forms. I have done code which change color of labels. But need to do same code for each label. Is there any solution. Please tell me how to do it.Thanks.
28 May 2012 by CPallini
Supposing you are working with Windows Forms, then you may iterate over all controls and apply your logic to all the found labels. See, for instanceHow do I iterate controls in a Windows Form App?[^] at Stack Overflow.
28 May 2012 by Adwaitam
HiI am having a DataGrid and need to change the color of the row in datagrid on clicking the Delete LinkButton in Datagrid.Please help.ThanKs.
29 May 2012 by Sandeep Mewara
You can do the following by Injecting Javascript function on onClick of link button for a grid row.For injecting JS, you need to use RowDataBound of GridView, something like:protected void GridView_RowDataBound(Object sender, GridViewRowEventArgs e){ DataControlRowType rtype =...
9 Jul 2012 by Wyrdathru
It looks like the only way to resolve this I could come up with was to use the OnTexTInput event and have it manually change every letter when typed. I fear for the issues of speed, but so far it seems to work.(I'll get used to this solution thing one day, maybe!)
11 Jul 2012 by cyborneo
Dear all Senior Programmer,hello, could you show me the link or source code to save and retrieve the color in datagridview ?Does anyone knows how to do that ?I want to store a color in a DataGridView(DGV) (that has been selected by the ColorDialog). The DGV saves to a flat file...
12 Jul 2012 by Maximilien
( I don't have Windows 7)Aren't you supposed to use a CMFCRibbonColorButton[^] to implement that feature ?
12 Jul 2012 by Code-o-mat
How about updating the image itself? So when the color changes you update parts of the image with the new color as needed and then make the button redraw itself.
12 Jul 2012 by nbtthief
Thank for replying!I know about CMFCRibbonGalleryButton, but this wont be what i want. If we use update image, so how many images i will prepare to change image (65,000+ color = 65,000+ images, OMG!)I have new solution, i will create new class derive from CMFCRibbonButton, then i'll...
1 Aug 2012 by Gabriel X
Hi!I have a Textbox in a WindowsForm project with a green backcolor.When I select some of its text, the selection appears with blue color which is hardly distinguishable from non-selected text.Is there any way I can change the selected text's color (and by chance, the blinking cursor's...
1 Aug 2012 by _Zorro_
Hi,Is this an ASP.NET question?I don't think you can override your OS controls. The only way I know is by rendering your own control, but creating an input from scratch is going to be a though task because you won't be able to inherit from the TextBox class.You'll need to handle your...
1 Aug 2012 by Gabriel X
Richard!Than...
6 Aug 2012 by Kenneth Haugland
Your problem seems to be how you read you XML file. You could do something like this: Dim name as string Public Sub Load(ByVal p_XMLfilename As String) XMLFilename = p_XMLfilename Dim x As New System.Xml.XmlDocument x.Load(p_XMLfilename) Dim...
8 Aug 2012 by Maciej Los
Have a look at this example:Dim oRow as DataGridViewRow = NothingFor each oRow in Me.DataGridView1.Rows If oRow.Index Mod 2 = 0 Then oRow.DefaultCellStyle.Color = Color.Yellow Else oRow.DefaultCellStyle.Color = Color.Blue End ifNextThe rest you need...
16 Aug 2012 by marshalDavout
Draws a sequence of ascending numbers evenly spaced on a grid system for use on game maps and such.