Click here to Skip to main content
15,896,513 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 Title

Color 

24 Nov 2009 by Dan Neely
I have some bitmap images being displayed in a DataGridView's and on custom controls.  These are all basic lineart type images not pictures.  I recently noticed that they all looked slightly faded/washed out and when I examined screenshots I took I discovered that any color channels that should have
23 Nov 2009 by Christian Graus
What format do you use ? jpeg is lossy, and the colors in a JPEG will change.
24 Nov 2009 by Dan Neely
I ended up tossing the image stream and getting the images from the Resources.resx file instead.  Slightly more work; but this means that the images will always be accessed from the originals in source control and that any changes to the images will be automatically included in the next build.
18 Mar 2014 by Johannes Bildstein
Reading and writing Bitmaps with full 16bit per channel (and possibly more)
25 Dec 2013 by kodmail
I have 512*512 16 bit raw 'Lena' data I wanna show this data 24bit or 32bit depth colored image. I use C#.I show this data 16 bit gray scale;gray scale 16bit depth Lenabut I wanna show colored image as the given link colored Lena
18 Dec 2012 by marcel zol
How to save mixed 16 colors? When i re-open the color dialog i have to repeat selections.
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.
2 Dec 2012 by Krunal Rohit
I'm agreed with Mr SA.. Don't use this kind of names for controls..and your answer is here:private void ChangeTabColor(DrawItemEventArgs e){Font TabFont;Brush BackBrush = new SolidBrush(Color.Green); //Set background colorBrush ForeBrush = new SolidBrush(Color.Yellow);//Set...
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)[^]
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...
10 Mar 2010 by priyanka 2010
hallo guys;m a student,m working over a project on training andb placement cell for our colz.d platform is on javascript and oracle 9i.plz help me out regarding dat project.
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 Jul 2016 by Andy Point
Android Material Design: Working with Floating Label EditText
12 Nov 2022 by PartisanIsaac
I was making a small block drawing package with Node.js, and i was tinkering with it, but at the exact moment i put a ANSI Color code, it started to break. Before: Image[^] After Image[^] The reason that makes it break is that all the...
11 Nov 2022 by OriginalGriff
That's because ANSI escape sequences are just that: sequences. They have a common format: They start with an ESC character, and the following character either completes the sequence are indicates a Control Sequence if is is an open square...
12 Nov 2022 by Dave Kreskowiak
Quote: The reason that makes it break is that all the characters i use to make the ANSI codes work are being treated as just normal characters when i use the string .length property. That's because, in the terms of a string, they ARE normal...
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
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 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....
30 Aug 2017 by Ravimal Bandara
An implementation of Bag-Of-Feature descriptor based on SIFT features using OpenCV and C++ for content based image retrieval applications.
12 Oct 2013 by ASP.NET Community
This article will show you how to create a color selector control that will looks like the image in the right side.   The first thing to mention
30 Jul 2013 by azinyama
Good day all!!!I am using ButtonRenderer to create a button.ButtonRenderer.DrawButton(Graphics, ButtonBounds, ButtonImage, ImageBounds, false, ButtonState);My question is how do I make:01. The button borderless;02. Make the button color transparent.Thanx in advance for you...
30 Jul 2013 by walterhevedeich
For borderless button and with image, you may want to check the article belowCustom Button Control with Gradient Colors and Extra Image (VB.NET)[^]For transparent button, the following links may help:Transparent Buttons in...
18 Apr 2020 by Member 14782009
Im trying to start timer and changing backcolor of button (from static method). I tried this code but it didnt work : What I have tried: Application.OpenForms.OfType().Last().buttonName.BackColor = Color.LimeGreen; //Button Back Color ...
18 Apr 2020 by OriginalGriff
basically, don't use a static method. You need an instance of a form, make the method a member of that form and use the instance that provides. If you are trying to do this from a different form then you shouldn't - you are making that for (or...
5 Jul 2013 by wingchungs
hello can someone know how in c# get simillar to this:http://blog.soulwire.co.uk/code/actionscript-3/colourutils-bitmapdata-extract-colour-palette[^]
5 Nov 2016 by The Chaotic Void
So for my program I'm allowing the Users to customize the color of everything in the program so I made this function that does it.and saves the Users settings.But whenever the program Restarts for it to work like that, it doesn't work any help? ...
5 Nov 2016 by Mehdi Gholam
Application.Restart() will restart the application from defaults in the DLL files and all your in-memory changes will be invalidated.Try saving your default color to a config file and setting the colors on startup.
22 Nov 2022 by Graeme_Grant
You could convert from RGB to HSV/HSB and use the (H)ue to create your color groups, then (S)aturation & (B)rightness to do your sub-sorts. Then once sorted, display the RGB value. ref: The HSB Color System: A Practitioner's Primer – Learn UI...
23 Jul 2023 by Member 15840006
I got a tool from elsewhere It can list the pixel values used by the image i try to imitate it I use the memory method to extract image pixel colors values and remove duplicate values, but I can't achieve its sorting effect. Pixel Sort Sample...
17 Dec 2015 by Rencyrence
Hello, How can i change the color of the specific rows that contains "SOLD"Here's my code string a = dataGridView1.Rows[0].Cells[2].Value.ToString(); foreach (DataGridViewRow Myrow in dataGridView1.Rows) { if (a ==...
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...
6 Jul 2017 by Member 12702368
hello I search in w3scools and found something thing call Html color picker and this is the link : https://www.w3schools.com/colors/colors_picker.asp I did not found the html code of color picker , so I want the html code to use this color picker in my page , so I want when the user pick any...
6 Jul 2017 by Suvendu Shekhar Giri
You can use input element to have a color picker on your page. Something like following Note: Check browser support for HTML5 Thanks :)
6 Jul 2017 by RickZeeland
Use JQuery MiniColors Plugin: GitHub - claviska/jquery-minicolors: jQuery MiniColors Plugin[^]
6 Aug 2012 by cyborneo
Dear My Friends of Senior Programmer,Please Help me, my Problem is cannot retrieve and load the color from my XML file into datagridview (EVENT: FORMTES3_LOAD). the application isn't error but the display of my Datagridview become irregular.below is my FULL Source Code:Note : the...
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...
9 Mar 2017 by MinnyJay7
Hello!I have a Wordpress site and it was hacked! I am in the middle of cleaning up the mess, and almost done. My blog page background is still black. I am trying to find the code that made it black and replace it back to white! Not sure if I need to find a dropped code that was left by...
9 Mar 2017 by Bryian Tan
Check the header.php template under themes/WhatEverYourThemeName folder. Do you have a backup? If yes, restore from backup, then update all the plugins and template to latest and greatest.I would suggest scrap the whole thing and start from ground 0 unless you 100% sure the problem is fixed...
9 Mar 2017 by Peter_in_2780
Use your browser tools (eg Firefox Developer Tools / Style Editor) to examine the hierarchy of styles applied to that element. It'll tell you what styles from what files are active.
9 Mar 2017 by Graeme_Grant
Restore from backup would be the most obvious option. If you don't have a back, ask the hosting service if they do and if they could. Don't ask, don't get... The worst thing that they could say is no. After it is fully restored, make a backup!
20 Jul 2016 by sam7one
I have stuck in a weird problem... I have a girdview to display stock data. In this stock data I have to highlight NEGATIVE stock records in YELLOW. I did some google search for this and found a solution, which worked fine when I set this form as default form of application through...
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() ...
20 Jul 2016 by Member 12635235
45452 }private void dataGridView1_DataBindingComplete(object sender,DataGridViewBindingCompleteEventArgs e) { DataGridViewCellStyle myColor= dataGridView1.DefaultCellStyle.Clone(); myColor.BackColor = Color.Yellow; foreach (DataGridViewRow row in...
25 Mar 2015 by oronsultan
hey guys, new problem:i have 2 datagridview in my wpf window: DgIncome and DgOutcome.the DgIncome foreground is set to green and the DgOutcome foreground is set to red.on both datagridviews, when i click one of the rows, the cell foreground changes to white and that ok.whats the problem?...
26 Mar 2015 by oronsultan
Private Sub DgOutcome_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles DgOutcome.SelectionChanged DgIncome.UnselectAll() End Sub
22 Dec 2013 by Patel Shweta
function binds() { $.ajax({ type: "POST", contentType: "application/json;charset=utf-8", ...
22 Dec 2013 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
Add bgcolor property to header tr.$("#GridView1").append("NameDeparNameAgeAddressImage");
22 Dec 2013 by viprat
Hi,you can set the color using css.See the below link. It might be help to you.http://forums.asp.net/t/1378044.aspx[^]
23 Jul 2015 by ChrisCreateBoss
I'm working on winForms C# 2.0.I want to change the backcolor of my menustrip. It looks as simple as writing menustrip1.Backcolor = Color.FromArgb(38, 37, 37); but I'm having two problems:1) all toolstripmenuitems are still with the control backcolor. (I already set their backcolor one by...
23 Jul 2015 by Sergey Alexandrovich Kryukov
You can always traverse all menu strip items using the property Items and change the background color of each...
22 Mar 2013 by Dheeraj Singh Bhadoria
This Artical shows that how we can change the color of any image throw Bitmap
2 Apr 2013 by Janani Muthaiyan
I am having the gridview as follows.. I need to change the row color based on the color value in db.//ASP.NET//C#.NET protected void GridView1_RowDataBound(object sender,...
2 Apr 2013 by vijay__p
Hello,OnDataRowBound Event you can set the color of row based on your condition.protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { ...
2 Apr 2013 by Maciej Los
Use GridViewRowEventArgs e passed into GridView1_RowDataBound procedure:if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.BackColor = Color.FromName(StringValueReturnedByQuery); }But before... have a look at below SP:CREATE proc [dbo].[gridcolor] ...
11 Apr 2017 by Member 13120298
Hello, I'll try to explain this as best as I can, but I learnt to code mostly practically without actually reading that many tutorials so please forgive any use of the wrong technical jargon. I've been coding themes on tumblr for a while and they have a feature that allows you to change the...
11 Apr 2017 by Member 13120882
I'd recommend using basic javascript as CSS doesn't allow for variables. Maybe use a framework like Sass or LESS but that requires learning the frameworks, which can be difficult for most people. For example, var color1 = "#990dfa"; var someDiv = Document.getElementById('yourDivId');...
14 Aug 2020 by Fa3o
Hello.Well, I have a form loaded with lots of (Label/TextBox)s, and i have a color switch option in the form, And I'm using the simple code which is this: TLab.ForeColor = My.Settings.B HLine1.BackColor = My.Settings.B HLine2.BackColor = My.Settings.B ...
2 Mar 2016 by Michael_Davies
You can enumerate the controls in a form without keeping a separate list of objects.Probably best done as a recursive function as you can have container controls inside container controls and the example below only goes two deep.For Each x As Control In form1.Controls If...
3 Mar 2016 by FatzBomb
Michael presents a very good solution. However, you can shorten your code if all of the controls are of a certain type using the OfType(Of Type) parameter. Labels are not Container Controls so the recursive function below is pointless, but you can use it for any control type you want.' Put...
14 Aug 2020 by Member 14914654
Dim rnd as New Random If Label1.ForeColor = Visible Then Label1.FolorColor = Invisible Else Label1.ForColor = Color.FromArgb(rnd.Next(256), rnd.Next(256), rnd.Next(256))
11 Oct 2013 by ASP.NET Community
It's a hot topic among web developers that is it possible to change the color of HTML bulletin list? Well, as many says, it's impossible, there is
24 Jun 2013 by Tejashwi Kalp Taru
Ever wanted to change the Windows Aero color without restarting the DWM?
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!
2 Feb 2011 by Babak.B
:) fasttour
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.
13 Mar 2017 by JeezyWonder
Hello, im new at vb.net, what im trying to do is that textbox3 and texbox5 have a data, and i want to make a "compare" button, when i click it, it will collor they data diffrences with red, colored data will be shown in texbox3. the code from vb6(this codes works well btw):Private Sub...
13 Mar 2017 by OriginalGriff
Textboxes cannot be coloured except as a whole: they do not have any "individual word" formatting facilities.To do that, you'd have to write your own TextBox control - or use the built in RichTextBox control which would work in much the same way as the one in your VB6 code...
16 Feb 2013 by MohamedKamalPharm
C#, Color, VB.NET, comparisonC#, Color, VB.NET, comparison
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.
6 Jul 2014 by 曦 陈
I am doing a project about Xserver, and I want to reuse its color conversion mechanism. But sadly I couldn't find where that part of codes reside. Does anyone know about it? Or can anyone recommend to me some articles about color conversion or relative code snippets?
19 Apr 2011 by Member 7810323
I have done a project in Visual C# Express 2010. When we move a mouse pointer on to the image and click on a image, the color under the mouse pointer would be displayed and R,G,B values can be displayed in a textbox.But I am unable to do the same project in Silverlight Application i.e., WPF...
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.
24 Dec 2014 by Boudi AlSayed
Hi All, I'm just wondering if there is a simple and fast way to get color scheme from an image?? I didn't find any result on the internet after searching for 1:30 hour... I'm not expert at Graphics codes and these stuff, but for my project the method should be very fast because it will have to...
24 Dec 2014 by Kornfeld Eliyahu Peter
In WPF, BitmapSource has a Palette[^] property, however consider that not all image formats has palette. Only indexed (like tiff, gif and some kind of bitmap) formats has palette, for other formats you have to scan the image pixels and gather the color information from there...
24 Jun 2015 by Kornfeld Eliyahu Peter
“The colors of the world are changing day by day!” - Les Misérables
30 Aug 2020 by Peter Occil
Discusses color spaces, color generation, and other general color topics commonly faced by programmers
24 Feb 2022 by Shmuel Zang
Simple Java helper class to print colored text in console window.
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);... :)
24 Nov 2013 by Johannes Bildstein
A library for colormodels and spaces, correct color-conversions and color-difference calculation.
7 Jul 2012 by Wyrdathru
Hi guys,I'm trying to get this little app to colour text that is selected when a button is pressed, or colour anything that comes after the caret when typing if nothing is selected. This works, but I have a bug where, if I insert the caret between two characters and press a button,...
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!)
7 Mar 2011 by hain
I am so confused...Can anyone point me to (or give me) a good explanation of the difference and relationships betweenSystemColorKnownColorNamedColorOLE color (what does OLE stand for here?)HTML colorAt least I know what ARGB is :sigh:Thanks,Tom
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...
19 Nov 2013 by JohnLeitch
ConsolePlus aims to build upon the existing System.Console class by offering a styling language for coloring console output. This enables developers to create applications with rich console output, while minimizing boilerplate code.
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 ?
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.
4 Oct 2014 by Member 11127394
I need to create a Label where I can color any character in the Text with a different color. The property I want to use is:Label.Text(PositionOfCharacter as Integer).color = color.ColorNameI am using VB.Net.Thanks in advance
4 Oct 2014 by Sergey Alexandrovich Kryukov
Please see my comment to the question. You need to specify what do you want to use.The solution can be found in these CodeProject articles:For System.Windows.Forms: A Professional HTML Renderer You Will Use[^];For WPF: WPF HTML Supported TextBlock[^].If you use ASP.NET, the solution...
22 Apr 2013 by assamheart
Crop a photo and signature from an scanned image
15 Mar 2021 by Peter Huber SG
Covers in depth all WPF color related issues from Color Models, ColorPickers, Colors to helpful methods for mixing colors and making them brighter and darker.