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

Color 

25 Oct 2023 by Matt T Heffron
The only (that I can think of) way to have a variable number of pieces of a text column in different colors (based on two independent values) is to extend the TextBlock control to self-construct its content. Here's what I've done. using...
3 Oct 2023 by Marco Giglio
I created this code (I'm only showing part of it) where I read an XML file and display it in a datagridView. In this, the attribute (table:style-name="ce215") changes the background of the single cell of the datagridview to yellow, but I can't...
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...
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...
7 May 2023 by ToughDev
More about ST7735 1.8-inch 128×160 Color LCD on a PIC Microcontroller
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...
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...
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...
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...
26 Jul 2022 by sheena k
Unable to see colororacle simulator after download from "http://[DELETED].org/" , please help me what i need to download to see the simulator check the link below - L.H.S simulator is not enable in my window 10 machine ...
26 Jul 2022 by OriginalGriff
Don't ask here: ask the people who created it. If you go to their site, they have a "feedback" link. And be careful what you post: your URLs triggered the automated system to consider you a spammer and has thrown you to moderation. You will...
1 May 2022 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.
27 Apr 2022 by Emmett O neill
Hi I am creating a Rubik's cube detection program for OpenCV in order to detect the colour of each individual cubie however i am struggling to tell the difference between colours such as red, orange and yellow. I have investigated this throughly...
27 Apr 2022 by matblue25
Maybe because you have overlap between the yellow and orange ranges?
7 Apr 2022 by Chris Maunder
A quick overview and a simple Windows CMD script to make your terminal output a little more lively
7 Apr 2022 by Chris Maunder
A quick overview and a simple bash script to make your script output a little more lively
24 Feb 2022 by Shmuel Zang
Simple Java helper class to print colored text in console window.
19 Nov 2021 by
Image class which contains an array of unique colors with counts used to sort by color and find duplicates.
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,...
28 Sep 2021 by ZhiXun H
I have new solution, i will create new class derive from CMFCRibbonButton, then i'll override OnDraw or DrawImage method. I'll update my approach later. Is there any update about this?
18 Aug 2021 by Richard MacCutchan
This is the same question as How to generate random hexadecimal colors between min and max?[^], and you have already been given the answer.
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) +...
18 Aug 2021 by Mehrez Kanzari
I'm trying to generate random hexadecimal colors between this range: min= #00FF00 (green) and max= #FF0000 (red). What I have tried: I made my own search but I found only how to generate random hexadecimal colors not between two hexadecimal...
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.
19 Feb 2021 by Rabee Rabee
hii want to convert from System.Drawing.Color to HTML color, i want the color code not the color nameMessageBox.Show(System.Drawing.ColorTranslator.ToHtml(System.Drawing.Color.Red));output: Redi want: #FF0000thanx
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....
6 Oct 2020 by KD209
I want to change the color of a string, but only a portion of the string. This string will be pull and send out via email (smtp). If GroupBox1.Enabled = True Then Q1 = ("Question 1 - Symptoms: " + GroupBox1.Enabled.ToString) '
30 Aug 2020 by Peter Occil
Discusses color spaces, color generation, and other general color topics commonly faced by programmers
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 ...
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))
30 May 2020 by LeMS_Studios
Is there a way to get of list of colours that are in the different colour pallets, like 16 colours, 256 colours, 16-bit, 24-bit and 32-bit? The full picture is that I need a function that converts a colour to colour from the palate. What I have...
30 May 2020 by RickZeeland
Maybe this will be helpful: A Simple - Yet Quite Powerful - Palette Quantizer in C#[^]
26 May 2020 by ncostasilva
p_test_timer.Text = controller.Read("mw40").ToString(); ///write test status into the start button int test = int.Parse(p_test_timer.Text); int timerValue = test; if (timerValue > 0) ...
26 May 2020 by ncostasilva
Hello Colleagues, I'm just leaning C# and I want to change a button color / label if the text.box show different values, for example the text box is a counter from 0 to 60 seconds send by an external controller (tester), so it can sometimes...
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";
22 May 2020 by phil.o
If you want a random colour from a collection, then just generate a random index into the collection: int count = theCollection.Count; Random r = new Random(); var randomValue = theCollection[r.Next(0, count)]; // You now have a random element...
22 May 2020 by Member 12618031
Is there a way to randomly get colors from a collection System.Windows.Media.Brushes or System.Windows.Media.Colors. I'm interested in getting a pair - (color name, color). P.S. I know about the way to get a random color without a name. Random...
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...
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 ...
23 Mar 2020 by SeaWater
Setting the BackColor property to any color before you set the ReadOnly property of a textbox to true solves the problem: private void setTextBoxReadOnly(TextBox txtBoxToChange) { txtBoxToChange.BackColor =...
23 Mar 2020 by JacoBosch
Good dayI made my textboxes reaadonly and I want to change the forecolor of the text inside of the textboxes.I have written the following code, but it is not changing the forecolor of the text inside of the textbox to grey.txtVersion.ForeColor = Color.Gray;How can I change the...
28 Jan 2020 by Richard MacCutchan
Support - National Instruments[^]
28 Jan 2020 by Member 14729505
Im using Labview and im trying to get a single pixel color value of HSV starting on the x0 y0 coordinates from my picture, x1 y0, x2 y0, ... at the rows and then continue to columns. Where would i get the frequency of each color (0-255) on the whole picture at the table with one column for H =>...
19 Dec 2019 by DrgIonuţ
I have a SVG external file which is called in an tag. The SVG contains two groups.
19 Dec 2019 by Richard Deeming
Change the selector you pass to the find method so that it only finds stop elements which are descendants of the element with the required ID: $("object").contents().find('#g1 stop').each(function () {
29 Nov 2019 by RickHamton
I want to create an alert effect on a button by cycling between two colors randomly. What I have tried: private void timer1_Tick(object sender, EventArgs e) { Random rand = new Random(); int A = rand.Next(256); int R = rand.Next(256); ...
29 Nov 2019 by RickHamton
int timeleft = 2; private void timer1_Tick(object sender, EventArgs e) { Color color1 = Color.Red; Color color2 = Color.WhiteSmoke; if (timeleft > 0) { NotificationBtn.BackColor = color1; timeleft...
16 Jul 2019 by Hazem Elamir
i have a pic of some form which i like its colors i have open it in adobe and get its color code put the color in my background WPF form but it gives different color i have used also paletton.com but same different i have used sharp dev (tool to create plug in for revit) and its working fine...
16 Jul 2019 by Hazem Elamir
many thanks for your replay what i'm doing is that i capture the color i like then paste photo into adobe use picker to get the color number put the number in wpf form but get a little bit different color not only darker or lighter ie i pick dark blue but in wpf it moves to gray or getting...
25 May 2019 by dynamichael
Build an oct-tree from a color palette for a fast nearest color search
6 Apr 2019 by Member 12994860
Change the Font Color of all Equations in a Word Document
3 Apr 2019 by Gerry Schmitz
Colors will look darker or lighter depending on the background; you'll only get a match (visually) if you overlap. If you want the "true" color, use a color picker; don't "eyeball". You can use a screen capture in Paint.Net (for example) and the color picker to get RGB values for the WPF app.
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...
29 Jan 2019 by lock&_lock
I'm working with OpenGL and C. I have RGB input in openGL and need to do computation in CIE XYZ color space. So I do conversion following this color conversion rules. |X| |0.412453 0.357580 0.180423 | |R| |Y| = |0.212671 0.715160 0.072169 |.|G| |Z| |0.019334 0.119193 0.950227 | |B| ...
27 Jan 2019 by Richard MacCutchan
See sRGB - Wikipedia[^].
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[^]
16 Dec 2018 by Kyserx
I wanna change button colors when the user click on it. The main plan is: every month 10th one worker's button go to red and if the worker done his job then click on the button and it going to be green. I have no idea what to do. I already have this code... I just created a window and add a...
16 Dec 2018 by Richard MacCutchan
You need to use the custom draw feature, see Button - Windows applications | Microsoft Docs[^]. I would suggest getting more familiar with the general use of Windows controls first. Custom drawing is a slightly more advanced subject.
10 Nov 2018 by Bjørn
Editing GIF colors without touching the image data within
8 Sep 2018 by Member 13977575
So.. the things is: I've created a small 'level editor', just like that, for fun and the experience. Anyway, I've finished it, but couldn't find a way to make the player be able to interact with the objects that are placed by the user, as if I check with colliderect it doesn't work because the...
21 Jul 2018 by Member 13921225
currently i am working with project on colour detection of resistor using image processing.But i am unable to get the results for all images.Pleae help me. What I have tried: I have treid the following code.... clc; close all; clear all; [fname path]=uigetfile('*.*','enter an image');...
22 May 2018 by Member 13839309
Have been trying to find a solution to this problem and found this site. Am not a coder (not even close), but hopefully someone who is can help out or point me in the right direction? The background: I'm working for a photographer who is interested in starting some paintings. He has a very...
11 Apr 2018 by Member 12674862
List> MyValue = new List>(); MyValue.Add(new KeyValuePair("Maths", 200)); MyValue.Add(new KeyValuePair("Physics", 136)); MyValue.Add(new KeyValuePair("Chemistry", 189));...
16 Feb 2018 by faiqaa
I am saving stock details including product ID,product name,price and quantity into a text file and then displaying this information in a list box, each row consists of the details I've listed above. Now my aim is to highlight in red the quantity of the product only if the value is below 5, so...
16 Feb 2018 by Ralf Meier
You need to build up your own customized Listbox which has this Behaviour. One possible sample could be this : Owner drawn ListBox[^]
16 Nov 2017 by The Prateek
I'm trying to write code to detect color of particular area of image. So far I have come across is using opencv, we can do this, But still haven't found any particular tutorial to help with this. I want to do this with javascript, but I can also use python opencv to get the results. can anyone...
7 Oct 2017 by Arlert
Trying to detect source color after mixing it with another one. What I have tried: For example: A R G B source 255 128 64 64 overlay 204 0 128 128 result 255 26 115 115 After mixing source color with overlay (with normal blending mode), i get the result color. Knowing, that source...
7 Oct 2017 by Patrice T
Quote: The first trouble I face, is that the result value is rounded, so instead of 25.6 (for result R), I will get 26 (because rgb are byte values). That is the problem when you use integers in a formula that use division and that what is divided is not multiple of divisor. There is...
7 Oct 2017 by Steve44
The only way to avoid problems introduced due to rounding is to avoid rounding. In your description you did not mention what the data types for the colors are, but it seems they are integers, so every precision of your calculation that is "rounded away" is gone in the integer case and there is...
5 Sep 2017 by Hassaan_Malik
The default color space of OpenCv is RGB. While HSV has also same color space. Moreover, HSV also helps a lot in color segmentation. Then why OpenCv has stuck to RGB? What I have tried: I did not make any attempt to code that.
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.
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.
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 RickZeeland
Use JQuery MiniColors Plugin: GitHub - claviska/jquery-minicolors: jQuery MiniColors Plugin[^]
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 :)
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');...
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...
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 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!
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 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...
16 Jan 2017 by Member 12802669
I have a gridview and if the condition = true/accept, then the row will be green. Otherwise is White. If I select a normal (white, without condition) row and click on, the Color changes to blue.But if I click on a red row it still be red. I want that, no matter what, that it always changes...
16 Jan 2017 by Sunasara Imdadhusen
You can use following:protected void GridView1_SelectedIndexChanged(object sender, EventArgs e){ if (GridView1.SelectedIndex > -1) GridView1.SelectedRow.CssClass = "blue";}ORprotected void OnSelectedIndexChanged(object sender, EventArgs e){ foreach (GridViewRow row...
16 Jan 2017 by Sunasara Imdadhusen
You can use following:protected void GridView1_SelectedIndexChanged(object sender, EventArgs e){ if (GridView1.SelectedIndex > -1) GridView1.SelectedRow.CssClass = "blue";}
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...
5 Jan 2017 by Canal Ten Thousand
I have a function which should change the colors in an image to their opposites. Red to green, green to blue, and blue to red. I have thinking and trying for a while now, but I can not get it to work. However, I know that there is not any problem with my code. Because the image does change...
5 Jan 2017 by Jeremy Falcon
If you want the inverted color which affects both hue and lightness, a simple invert will do.Just convert from hex to RGB and invert each channel,R = R *-1 + 255G = G *-1 + 255B = B *-1 + 255And then convert back to hex.If you want the opposite hue, without affecting...
5 Jan 2017 by Graeme_Grant
A quick search of CodeProject in less than 30 seconds served up this gem: Fundamentals of Image Processing - behind the scenes[^]
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.
4 Sep 2016 by Member 9983063
Hello guys! i want to know how to change forecolor of datagridview last row.What I have tried:textBox2.Text = Add_Food_Inventory.setaluefortext204; dateTimePicker1.Text = System.DateTime.Now.ToString(); dateTimePicker2.Text =...
4 Sep 2016 by Karthik_Mahalingam
tryif (dataGridView1.Rows.Count > 0) dataGridView1.Rows[dataGridView1.Rows.Count-1].DefaultCellStyle.BackColor = Color.Red;
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...
3 Aug 2016 by RossMW
You are trying to change the colour of an int I not the listbox item.Use owner-draw mode of the ListBox. Select your ListBox in design-mode and change DrawMode property to OwnerDrawFixed. Now attach a handler to DrawItem event and then use Graphics class's methods to draw your string in any...
3 Aug 2016 by Member 9983063
how to change font color of listbox selected items C# on button clickWhat I have tried:for (int i = 0; i
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...
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...
17 Jul 2016 by Andy Point
Android Material Design: Working with Floating Label EditText