FAQ Database Discussion Community


Android notification InboxStyle() with colored string

android,string,colors,notifications,spannable
Quick question with android InboxStyle(), can I have a colored string? I tried using Spannable like NotificationCompat.InboxStyle style = new NotificationCompat.InboxStyle(); text = "sample"; Spannable spannable = new SpannableString(text); spannable.setSpan(new ForegroundColorSpan(Color.GREEN), 0, text.length(), 0); style.addLine(spannable); but no luck... :( Am I able to add colors? Thanks!...

r stacked bargraph with colors representing values

r,colors,bar-chart,stacked-chart
I'm looking to make a stacked barchart with colors representing values from a separate data column as well as add an accurate color bar using just the base graphics in R. There is one other post about this but it is pretty disorganized and in the end doesn't help me...

Build a colorbar from a grayscale image

java,c++,c,colors
I've an 8-bit grayscale image representing intensities. I would like to display it with color according the intensity value (to be clear,something like this http://www.matthiaspospiech.de/files/matlab/plot/pcolor/pcolor-example-simple.png). I tried with an HSV scale (with H in (0->85) or (85->140) or (140->255) and then go back to RGB but it seems not to...

Converting images from RGB to HSL and back again with julia

image,colors,type-conversion,julia-lang,color-space
I have been trying to open some RGB images, view the data as a 2D array of HSL pixels, manipulate pixels in HSL space, convert back to RGB and write manipulated image to file. However I don't quite understand how the conversions in the (awesome) julia packages Color and Images...

android studio cannot resolve symbol “ff”

android,colors
I am trying to retrieve value of red, green,blue from pixel color value .So I need to perform some shift and multiply operation.But android studio notifying above error at following code. clr=bm.getPixel(0,0); cred=(clr & 0*ff)>>16; tv.append((String.valueOf(clr))); tv.append((String.valueOf(cred))); ERROR:Cannot resolve Symbol ff at line no 2;...

Repositioning button in HTML5?

javascript,html5,button,colors
I have 3 buttons on a page; one makes a soothing colour change, on makes a flashing colour change, and one should reset the page. However, the reset page button is not in the center. Please help: Here is my code: <html> <head> </head> <body> <SCRIPT LANGUAGE="JavaScript"> function iwarnedyou(){ intrvl=0;...

Limit the color variation in R using scale_color_grey

r,colors,ggplot2
Before I start, allow me to explain my graph: I have two Genotypes (WTB and whd) and each have two conditions (0 and 7), so I have four lines. Now, I want to make a plot where each variable and its condition is the same color. Anything with whd will...

Change button color using keyboard shortcut C# WPF

wpf,colors,control,inputbinding
I'm getting into some C# WPF, and am creating a simple word processor to convert normal text into wiki markup. I am new to WPF and am having trouble with something seemingly minuscule, and hopefully an easy fix. I have a Bold button on my main form. When pressed it...

Call user defined Color using Color.FromName, Visual Basic

vb.net,string,colors
I've defined a new System.Drawing.Color; Public CustomBackColor As System.Drawing.Color = Color.FromArgb(200, 4, 146) Now, I have a GlobalBackColor As String which I wanted to become my new CustomBackColor Value. My Question is, if there is any way to write CustomBackColor System.Drawing.Color, to the GlobalBackColor String. Or, to make the CustomBackColor...

How can i Create Color simulation with JFrame, JLabel, using setForeground?

java,swing,animation,colors,jframe
I really doubt this is the best way to do it, but this is what I am working with currently. I have these 3 JLabel objects in a JPanel. So 3 circles are in a JPanel at font 99. left to right the circles are colored R B G.The \u2022...

Dynamic text color changing

javascript,jquery,colors,jquery-animate
I have written this code for dynamic color changing of text. Function works fine, but problem is that there is a recursion. After call I have js "too much recursion" error. Is there a possibility, or another solution to do this without any problem? function dynamicColor() { $(".class").animate({ color: 'rgb(255,40,80)'...

Pebble SDK: Store color as a variable

c,variables,colors,pebble-watch,pebble-sdk
I'm make Pebble Time versions of my watchfaces. I want to be able to set a color variable that will hold a color depending on whether the Pebble Time is used or the Pebble OG is used. I know you can do this: #ifdef PBL_COLOR window_set_background_color(s_main_window, GColorDukeBlue); #else window_set_background_color(s_main_window, GColorBlack);...

Messed up color scheme in ReSharper C++

c++,visual-studio-2013,colors,resharper,resharper-c++
After upgrading to the latest ReSharper Ultimate version, my VS color scheme is kinda messed up. i have tried re-installing it, deleting the VC12_Config key from the registry and modify the "extensions changed file". If I suspend ReSharper my color scheme switches back to the default dark skin (which I...

How I insert color in a border of EditText?

android,colors
I need to insert the color blue in a border of EditText in my project. How I do it ?

Is it possible to have different colored graphs in a single series in HighCharts?

javascript,colors,highcharts
I have a single series column graph with x-axis as datetime and y-axis as some constant value. I would like to show the columns in different colors based on some information I have , is this possible ? e.g. I have dynamic data coming in to plot my graph,I use...

Actionbar background color changes on scale

android,colors,android-actionbar,scale
I used this code to change actionbar color that is used with appcompat lib: actionBar.setBackgroundDrawable(new ColorDrawable(R.color.teleblue)); but in use color changes and in different screen sizes color is different. I don't want to clean the original question with tricky ways. how can I fix it? thank you...

gstreamer wrong colors when converting h264 to raw RGB

linux,colors,rgb,gstreamer,gst
I have stream on one computer using this command: gst-launch-1.0 -e v4l2src do-timestamp=true ! video264,width=1296,height=730,framerate=30/1 ! h264parse ! rtph264pay config-interval=1 ! gdppay ! udpsink host=192.168.1.116 port=5000 So the output is h264 in YU12 format. I need this format in raw RGB, so on receiver site I use: gst-launch-1.0 -v udpsrc...

Matlab plot3 movie where the colour of each point varies depending on arbitrary vector

matlab,plot,colors,3d,movie
I have a set of data arrays that are nx6, where the 1st 3 columns are the x, y, z coordinates of a trajectory and n varies. I have written a script in matlab that allows me to plot each point in succession and then make it into a movie,...

Setting color palette in R

r,colors
I have been trying to produce a plot in just grayscale for the confidence interval fill and black lines for the predicted lines. I have tried every lead I find online and so far it has not produced a plot in grayscale. Much obliged for any help. For reference, Predictor...

Change Font Color on Overflow

css,text,fonts,colors,overflow
This is where I am trying to accomplish this effect: http://www.smalldot.agency/ccren/goals-page/ As the "val" bar increases in width, it should overlap the "current" text ((which is the same text as "val" but a different color)). I am able to force "current"'s copy on top of the "val" element, but I...

Selectioncolor doesn't work within KeyPress event

c#,winforms,colors,selection,keypress
I'm trying to change the color of some text when Ctrl+Z is pressed as the following: private void richTextBox1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Z && (e.Control)) { if (undoList.Count > 0) { ignoreChange = true; richTextBox1.Text = undoList[undoList.Count - 1]; //richTextBox1.Focus(); richTextBox1.SelectionStart = 3; richTextBox1.SelectionLength = 2;...

How to allow users the ability to customise their own area - colours or wallpaper

colors,wallpaper
I need help with some elements for my website, to enable logged in users to be able to alter the colour or background of their logged in area. I am looking for the best way to quickly accomplish this. I would like something similar to this: onclick="document.getElementById('id1').style.color = 'red'"> Click...

Getting RGB at Runtime from color

android,colors
I want to extract the RGB value from color My color is declared in xml as <color name="color_primary">#009688</color> Now I want the RGB value of this in my Activity at runtime. How to convert color_primary in Color object ? Any help? Thanks in advance....

ggplot2 geom_bar group stack order factor

r,colors,ggplot2,geom-bar
I am working on stack barchart and here is the test code : dat <- read.table(text=" cars trucks suvs 10 40 25 20 20 35 30 15 25 50 25 30 20 30 15", header=TRUE, as.is=TRUE) dat$day <- factor(c("Mo", "Tu", "We", "Th", "Fr"), levels=c("Mo", "Tu", "We", "Th", "Fr")) library(reshape2) library(ggplot2)...

some text of my cells changes color when I scroll my tableview

ios,uitableview,colors,cell,changes
when I compile my code, i have no error and the result is good but when i scroll in my tableview some cells become in red color. the purpose is to display in red color all the taks which had passed the due date I think the problem is here...

Android color for Material Design

android,colors,material-design
I am still a begginer in mobile app development. I am trying to create a android mobile app and still unable to find a good color combination for the app. When i was search for the color combination / color palette, i found the Material Design Guide by google here....

Translating Minecraft Color Codes into HTML

javascript,jquery,html,colors,minecraft
Recently, I was trying to convert Minecraft MOTD into Plain HTML. A Minecraft MOTD is basic text, with Minecraft Color Codes to represent color changes. Example: "§d§lThe Nexus§8: §6§oO_O §a§l[MUTATION MONDAY]" Translated: <span style='color:pink'><b>The Nexus</b></span><span style='color:gray'>:</span>... So on... So basically, there are color codes, which change the color of the...

How to set the marker color when using geojson.Feature

colors,geojson,marker
I am using python and my code is like: from geojson import Feature, FeatureCollection import json import sys, pymongo db = pymongo.MongoClient(host = '..........').database coll_name = sys.argv[1] point_list = [] citymap_cursor = db[coll_name].find() for doc in citymap_cursor: point_list.append(Feature(geometry=doc['point_latlng'])) with open('/path to/%s.json' % coll_name, 'w+') as outfile: json.dump(FeatureCollection(point_list), outfile) By this...

Storing colours in a database

mysql,sql,colors,sqldatatypes
I've read this question and the accepted answer advises storing colour values as strings in a database. However, the purpose of storing those values for that question was for display purposes. I would imagine that using SUBSTRING() and CONV() to get the values and convert them to integers is slower...

Text colouring in CSS within lists

css,colors
I'm working on CSS and i have a problem with colouring certain parts of a work. For example: <ul id="nav"><li>cats</li></ul><ul><li>dogs</li></ul> I want to color the part with 'cats'. I use li#nav{color: green;} to make "cats" green, but it is wrong. How would that be?...

How to interpolate four colors?

java,android,colors
I need to interpolate four colors in my microphone visualizer. 1 color white if user silent. 2 color red if user says softly. 3 color yellow if user says normally. 4 color green if user speaks loudly. Im create Paint void for change color but i don't know how to...

Change Form color constantly

c#,forms,winforms,colors
I want my program to constantly change the font background color, but I want it to go smoothly so I tried to modify a Color variable Color custom; and use it to for the background color of the form this.BackColor = custom; but it doesn't work and I don't know...

Displaying a color according with HSBcolor.Lerp?

c#,unity3d,colors,hsb
Basically I have a data visualization in Unity which i am using the Lerp function. Displaycolor = HSBColor.ToColor((HSBColor.Lerp(HSBColor.FromColor(Maxcolor),HSBColor.FromColor(Mincolor),0.3f))); I'm using this code to Lerp between my Min and Max Colors according to temperature but that part isn't working yet therefore i placed the 0.3f; This is the Color range i'm...

Java replacing the background of an image

java,image,colors,background,pixel
I am writing a program where I take one picture and replace the background of that picture. The picture I have is: And the background that I am using for the cat is: I know that in order to this I have to use the cat picture and take the...

Get button-clicked color of theme

android,button,colors
Is there a way, to get the button-clicked colour based on the current theme? The best would be a xml @color that I can use. I am planning to use this colour for my ImageButtons when pressed.

Fill Panel with gradient in three colors

c#,winforms,colors,color-picker,lineargradientbrush
I'm working on project and I have to do kind of color picker using C#. So I've decided that it will be a Panel with this background in Win Forms App. Background should have gradient with three colors in rgb: red (0 - 255), blue (0 - 255) and green...

javascript unique distinct color generator for new users in a chat application

javascript,colors
I want to adapt something like this: http://blog.adamcole.ca/2011/11/simple-javascript-rainbow-color.html But for a chat application where each new user gets a new most distinct color. Everytime a user enters my chat application my server responds with a new incremental number. (This code works fine). So the first user gets a zero, the...

Change All ToolStripMenuItem ForeColor

c#,visual-studio,colors,items,menustrip
I'm trying to change the color from every Item from the menu Strip, but the dropdown items I can't change.The dropdown menu items aren't white the way I want. My need is to change the ForeColor from every item with one code in the .cs file.

how to color specific words in a uialertview or UIAlertController ? (SWIFT)

ios,colors,uialertview
is there a way to color some specific words in uialertview ? I mean, can I color the word RED as red and at the same time GREEN as green ? Can someone bring me on the right way? ...

javascript,html,css,button,colors
How do I make a button change to another color when clicked and when clicked again it goes back to its original color? Can I do by using CSS or do I have to use Javascript? Thanks in advance This is the HTML code of my buttons. <div class="H1toH5"> <button...

Python Opencv Color range histogram

python,opencv,colors
I'm working in a project in which I would like to get a custom histogram from a given image. Let's say I want to count the number of pixels of three colors: Light brown. Blue. Red. I find easy to count the pixel that matchs a concret color, But I...

Change color of Bootstrap background navbar

css,colors,navigation,navbar
I'm curious how to change the color of the navbar. I'm using bootstrap business casual. Here's the picture of the navbar whose color I want to change. ...

How to plot colors on CIE 1931 Color Space in Matlab?

matlab,plot,colors,scatter-plot,color-space
I'm trying to plot few color values (co-ordinates) on the already plotted CIE 1931 color space. I've derived the XYZ color values which I want to plot, denoted as [X, Y, Z]- [50, 57, 10] [36, 43, 15] [28, 36, 8] [25, 32, 14] I using this function which plots...

Replacing multiple CSS color values simultaneously

javascript,jquery,css,colors
I am making a website where the user can select the colors of the page. The site is using only two colors. A background color and a color for everything else. (Text, Borders and background colors in separate boxes.) I try to get spectrum.js to change all colors other than...

Xcode + PDF images colors look darker in simulator/device (color space issue)

ios,xcode,colors,color-space
I know this isn't a new problem and I've done a full day (literally) of research. I use the latest Xcode 6, and I'm trying to use all PDF files as vector art resources. However, when I export these images from Illustrator in sRGB (sRGB IEC61966-2.1) , these images show...

White text in sublime text

colors,sublimetext2,sublimetext
I downloaded Sublime text from them website and my code still white, i don't know why. I unistalled and reinstalled it 3 times, tried to install themes packages etc i don't understand what is wrong. ...

How to visualize three separate arrays representing hue, saturation, and value in python?

python,matplotlib,colors,data-visualization,hsv
Is it possible to take three separate arrays representing hue, saturation, and value and plot them in python? I have two sets of data, one which I want to represent with hue and saturation, and another which I want to represent with value. I think this may be a similar...

Different colors in browser [closed]

css,firefox,colors,difference,color-profile
I have a strange problem in my browser. Color of page's elements looks different than I described in my css code. I checked it with browser's color picker and it showed right color (#5cb85c) and right preview of button's color. But when I did screenshot of page and checked it...

R-Project Barplot Colors

r,colors,bar-chart
I am new to R, and I am trying to create a simple barplot. I have been able to create a barplot with the correct values, but only a single color for all bars. If I change the code slightly ( using table() instead of as.table() ), I get the...

Converting a Number Matrix to a Color Matrix in R

r,matrix,colors
I have the following 4x4 number matrix containing the numbers 0-4: 0 1 0 3 3 2 1 4 4 1 0 2 3 3 0 1 I would like to understand how to convert number matrices into a color matrices using chosen colors and specific square dimensions (length x...

White lines in gradient.rect from R's plotrix package

r,colors,gradient,plotrix
Anybody have a solution for removing the white lines seen here in the graduated rectangles at the top of the plot? These are produced with gradient.rect from the plotrix package. gradient.rect(as.Date("1979-05-04"),70,as.Date("1990-11-28"),80,col=smoothColors("royalblue",100.0,"white"),border=NA,gradient="x") They appear both in the output from RStudio and in the exported PNG. ...

How to change background of TextView From EditText Text Change?

android,colors,background,android-edittext,textview
I am using Fragment class in which I want to change the color of Text View When text is changed on my edit Text. What are the possible ways to change the background color of TextView When Text is Changed in EditText . My code looks like this : public...

crop image, convert to black and white and sharpen it

r,image,image-processing,colors,raster
I want to take x, convert it into a black and white image. Then i want to convert all pixels that are below 100 to 0 and convert all pixels that are above 100 to 255. I want to get a sharper image where background will be white and objects...

C# (WinForms) - Find Colour of Cursor

c#,winforms,colors,cursor,screen
My Aim: I'd like to have the ability to retrieve the colour on the screen including the cursor, from certain coordinates. In other words, I suppose you could say I'd like to retrieve the colour of the cursor (or at least, a certain point/pixel on the cursor). My Difficulty: I...

JTable with different color value

java,swing,colors,jtable
I want to display data in a JTable like in the picture bellow: It can be observed that in the second row appear only 3 values, which I want to be colored. Also I have a problem in dispaying those rows, with the indentation. My disply so far looks like...

JavaFX - how to get background color of Tab, Button, etc

java,animation,colors,javafx,background
Problem description: I can't get background of object in JavaFX. I don't mean Shapes, but normal Nodes like Buttons, Tabs and others. I don't know how to access to theirs background color. What I want? I am developing IDE and I want to run Color animation on tab with file...

Shaded tittle does not displayed properly

html,css,colors,background-color,shadow
I list my projects here. All share the same style for the tittle, with a dark background for the inner body of the border the tittle lives in. However, my latest project got a logo ( :) ) which does not allow for a dark background. The reason as you...

VBA for changing font and colour of a cell if a certain word is typed in it

excel,vba,excel-vba,fonts,colors
I have a somewhat large spreadsheet with a type of summary page that follows a calender layout. On this page I manually change the font and color of cells to make it easy for me to find certain things on it. For example, (I lecture mathematics) if I have revision...

Scrolling through colors effect in RGB

colors,rgb
I want to create a colour scroller effect. I have a function that I give it RGB values (eg. setColor(189,234,45)) and I want to change the colour rapidly but I don't want to get many repeats to create an effect of scrolling through the colours. I have tried tried the...

Formatting Text Color In JTextArea

java,swing,colors,jtextarea
I'm redirecting the Java console output to a JTextArea that is inside of a JPanel. I'm using System.out.setOut(new PrintStream(taOutputStream)) and System.out.setErr(new PrintStream(taOutputStream))for redirecting the output. The problem I'm running into that the text is always black when it's redirected to the JPanel. I want the setErr code to be red...

Python: list of strings, change color of character if found (using xlsxwriter)

python,colors,xlsxwriter
I have several lists I am writing to different columns/rows of an excel spreadsheet using xlsxwriter in python 2.7. For one list of strings (DNA sequences), I want to find certain characters in the string ('a','t','c','g'), change their individual colors, and then write the complete list of strings (multicolored strings,...

“Constant Expression required” Exception thrown when using Optional Parameters [duplicate]

.net,vb.net,exception,colors,optional-parameters
This question already has an answer here: Using Color As Optional Parameter In a function within a class 3 answers I get a "Constant Expression required" exception when running this Sub Procedure; Public Sub SolidFill(Optional SolidColor As Color = Color.Black) .... End Sub However, this happens only when using...

matplotlib fill_between does not cycle through colours

python,numpy,matplotlib,colors
Most plotting methods like plot() and errorbar automatically change to the next colour in the color_palette when you plot multiple things on the same graph. For some reason this is not the case for fill_between(). I know that I could hard-code this but it is done in a loop which...

Color bar graph according to grouping variable

r,colors,boxplot
I have been looking for some time on stack, but no answer correspond directly to what i am looking for. I want to plot some results in a bar graph, and color the bars according to the grouping values in another column of my dataset. So, column 1 is the...

Swift - Reading .jpg image for pixel color returning incorrect values

image,swift,colors,jpeg,photoshop
I'm trying to get the UIColor of each pixel from a jpg image in swift, the following code successfully gets each pixel color however the results are confusing me: func renderLandscape() { var landscapeImage = UIImage(named: "test") for var xPos = 0 as CGFloat; xPos < landscapeImage?.size.width; xPos++ { for...

Why won't the average color yield to a result other than black?

ios,swift,colors
I'm trying to set the color of a label according to the average color of the image behind it. If the average color is dark then set the UILabel text color as white, otherwise set it as black. I followed the tutorial here for the average color logic which seems...

Is there a way to programmatically darken the color given RGB values?

r,colors,rgb
Let's say I have the RGB values like this (in R, for example): cols <- c("#CDE4F3","#E7F3D3","#F7F0C7","#EFCFE5","#D0D1E7") Is there any way to programmatically derive the another set of colors which is the darken version of the former? It doesn't have to R....

C++ game color needed

c++,colors,pacman
I Started making a Pacman style game with C++, All I want to do is give each thing a different color like player(o)Yellow Color, Enemy Ghost(@)red color, Fruit(.) or whatever you call it a blue color, Obstacles(#)brown color and plus sign(+) a green color Hope you can help me #include...

android lolipop primary color doesnt change

android,colors,android-actionbar
According to this page http://developer.android.com/training/material/theme.html#ColorPalette I can change my my action bar colors by changing the primary colors. <resources> <!-- your theme inherits from the material theme --> <style name="AppTheme" parent="android:Theme.Material"> <item name="android:colorPrimary">#ff9688</item> <!-- darker variant for the status bar and contextual app bars --> <item name="android:colorPrimaryDark">#00796B</item> <!-- theme UI...

LibGDX shaperenderer wrong color

colors,libgdx,shape-rendering
I am in trouble setting the color of my rect. The color of my rect is grey with 0.5f alpha or black with 0. How could I set my color? This is the code : Gdx.gl.glClearColor(0, 0, 0, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); shapeRenderer.begin(ShapeRenderer.ShapeType.Filled); shapeRenderer.setColor(67 , 34 , 167, 0.5f); shapeRenderer.rect(0, 0, Width,...

how to generate light and pastel colors randomly in android?

java,android,colors
I want to set background color to my layout, color must be generated randomly, till now i am using this code to generate colors but the colors are so dark, but i don't want these dark colors, need only light and pastel colors. Random rnd = new Random(); int r...

Css fill div height with color [closed]

html,css,html5,css3,colors
Hey guys I'm having troubles setting a div to fill the whole web with X color (with no height, it has a 30% of widht and I want to fill the rest of the web) , here's the example : http://gyazo.com/a074f0c6f86dc2a001aba53c672da03c , the div on the left is the one...

How to change ViewPort3D background color in WPF?

c#,wpf,colors,background,viewport3d
i have viewport3d and i want to change its background color. i am very new to Wpf. i didnt understand what to do from other posts. so i ask here. i changed brush property for viewport3d but it does nothing <Window x:Class="W3DTinker.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="800" Width="1200"> <Grid HorizontalAlignment="Left" Height="780"...

Colorbar - axis ticks in Matlab

matlab,plot,colors,matlab-figure
I am using the code below d3 = vals; n = datesmonth; figure plot(n,d3); colormap(jet(12)); hold on plot(n, d3,'b-'); scatter(n, d3, [], RiskierInd, 'filled'); caxis([1 12]); colorbar('YTick',[1:12],... 'YTickLabels',{'Non-Durables','Durables','Manufacturing','Oil, Gas and Coal ','Chemicals','Technology','Telephone & TV','Utilities','Wholesale and Retail','Health','Finance','Other'}) datetick('x','mm-yyyy') to produce this figure I have two quick questions: Is it possible to...

Problems with changing colors in chart winform

c#,winforms,charts,colors,series
I have a list with checked checkboxes. All the items on the list is painted on a chart as a line. When I uncheck an Item, this item must be painted as a gray line. This do also happen, but NeXT item in the list gets the color of the...

How to apply flat shading to RGB colors?

graphics,colors,3d,rgb
I am creating a small 3d rendering application. I decided to use simple flat shading for my triangles - just calculate the cosine of angle between face normal and light source and scale light intensity by it. But I'm not sure about how exactly should I apply that shading coefficient...

How can I control the color and opacity of each point in a python scatter plot?

python,colors,opacity,scatter-plot,4d
I'm looking to graph a 4D data set (X, Y, Z, intensity) using opacity to represent intensity. I also want the color to be dependent on the Z variable as well to better show depth. Here is the relevant code so far, I am a novice when it comes to...

Lab-image values on both of a and b axises exceeds the range

java,opencv,image-processing,colors,javacv
i converted a color image to Lab-color space, and when i displayed the values of the Lab-image, i found that the values of the pixels on the a-axis and b-axis are greater than 128!! while the values on the a-axis and b-axis should range from -128 to +128 please let...

Output for getRGB()

java,colors
I'm making a Connect Four game, and I need to set my pieces for the game, they will either be Black or Red, to have an int value for my algorithm that detects wins which utilizes a 2D Array. The ConnectFourPieces constructor takes in a Color which is then stored...

How to get the pixel value on the a-axis and b-axis of CIELAB image

java,opencv,image-processing,colors,rgb
i converted a BGR image to LAB color system, and i want to know the exact value of a pixel in the LAB image on the a-axis and b-axis. as shiwn below in the code, when i use dst.get(0, 3)[0] to display the pixel value of a pixel in the...

Convert a 0-1 value to a hex colour?

javascript,colors,hex,rgb,rgba
I'm creating an app that visualises stars using a NASA API. The colour of a star comes back as a 0 to 1 value, with 0 being pure blue, and 1 being pure red. Essentially I need to set up a way to convert 0-1 values in javascript to a...

Color Transfer: What's wrong with my code in OpenCV C++

c++,opencv,colors
I want to implement the color transfer algorithm in this paper and I refer this tutorial to transfer the algorithm in OpenCV C++. But I got some strange result, for example: This is the source image and this is the target, but the combined result look like this. Some part...

Is it possible to turn an entire webpage to grayscale using CSS?

css,colors,grayscale
I would like to turn an entire website to grayscale. Of course, I can manually edit the CSS and adjust every single color, background-color & co. property, and I can adjust every single image in Photoshop. But is there an easier way, e.g. by using pure CSS? E.g., something such...

How can I have different background colors in the same animation?

css,animation,colors,background,animated
On my nav bar I have 4 different buttons and I want each one of them to have a different color when I hover them. Here is a demonstration. And here is the code used for the animation: .hvr-underline { display: inline-block; vertical-align: middle; -webkit-transform: translateZ(0); transform: translateZ(0); box-shadow: 0...

I used a for loop to draw different curves. But how can I change every line to a different color?

javascript,colors,html5-canvas,curves
In my draw function I draw everything. I draw the white rect because you can change the position of every curve and otherwise you will see all of them. Not just the one with your new position. function draw() { var canvasWidth = canvas.width; var canvasHeight = canvas.height; ctx.fillStyle =...

OpenCV convert color per pixel

android,opencv,image-processing,colors,pixel
Hello i want to convert the color in image, i'm using per-pixel methods but it seems very slow src.getPixels(pixels, 0, width, 0, 0, width, height); // RGB values int R; for (int i = 0; i < pixels.length; i++) { // Get RGB values as ints // Set pixel color...

Background color change of found text in notepad++

colors,notepad++,highlighting
when i search a text pattern using "find all in current document" option in Find window, how to set the background of the selected result. Like currently i am searching "I" in the complete file, need the search result background to change when i select a particular line. attaching a...

Android: How to change the color of the dateselector in Datepicker widget?

android,colors,datepicker,calendar,selector
this is my first time posting a question. I've successfully implemented a Datepicker in my app (targeting only SDK 21 and above). I also want to style my Datepicker to blend with the rest of the app. This is what I have: <style name="MyDatePickerDialogTheme" parent="Theme.AppCompat.Light.Dialog"> <item name="android:datePickerStyle">@style/MyDatePickerStyle</item> <item name="android:colorAccent">@color/primDark</item> </style>...

Change the color of a portion of a gridview templatefield

asp.net,gridview,colors
I have a templatefield in a gridview to display contact details. I managed to format the static parts, i.e. 'Contact', 'Position', 'Number' and 'Mobile'. Contact: Dieter Position: Code-jockey Number: 061 323 9484 Mobile: 027 450 2345 My code is as follows: <asp:TemplateField HeaderText="Contact Details"> <ItemTemplate> <asp:Label ID="txtContactDetails" runat="server" CssClass="right" TextMode="MultiLine"...

assign RGB values in java with nested for function

java,colors,rgb,pixels,javax.imageio
I have some question, here is my code : int W = img.getWidth(); int H = img.getHeight(); int [][] pixels = new int [W][H]; int [][][] rgb = new int [3][H][W]; for(int i=0;i<W;i++) for(int j=0;j<H;j++){ pixels[i][j] = img.getRGB(i,j); Color clr = new Color(pixels[i][j]); rgb[0][j][i] = clr.getRed(); rgb[1][j][i] = clr.getGreen(); rgb[2][j][i]...

How can I make this timer() work as I want?

java,swing,timer,colors,jframe
I am having a bit of trouble with the code before. It is doing what I want, but I can only call the method once, if I call it more than that it won't work, essentially it only works once. So right now this ballG is an object. It starts...

Convert color to RRRGGGBBB

c#,winforms,colors,rgb,ini
Currently rewriting an .ini file of an existing program. This .ini file contains rgb values. Now I am changing the rgb values but the problem is that the existing program only reads the value if both the r, g and b values have 3 numbers. For example, if I write...

Convert grayscale to color gradient in Java?

java,image,colors,mapping,grayscale
Is there any general algorithm or a provided class for mapping a grayscale value (0-255) to a value in a colour gradient? I am thinking of something of the sorts: public Color mapGrayscaleValue (byte value, Color[] gradientColors); I am wanting this to provide clearer highlights in what would otherwise be...

Set Colors of zoomable treemap conditionally

javascript,json,d3.js,colors
I am using the D3 library to create a Zoomable Treemap for my application data using Javascript and JSON. I see online that many times d3 category for Color is being used to determine the colors of each section. However, I wish to color the sections of treemap using my...

JNI C++ to Java 32 bit image not showing properly

java,c++,colors,bitmap,jni
I have the following C++ code for JNI And the following Java code to create a 32bit bufferedimage, the sizes are also received through JNI Everything seems to work only that I have some weird colors in the image and I don't know how to get it right Result of...

kivy: press button -> change color of a label

python,canvas,colors,label,kivy
in the kv File I added a Label and changed its color: Label: id: ampel_rot canvas.before: Color: rgba: 1, 0, 0, 0.3 Ellipse: size: self.size My aim is to create some kind of a traffic light, so that the user of the GUI has some kind of visual feedback over...

How do I color individual cells of a JTable based on the value in the cell?

java,swing,colors,jtable,tablecellrenderer
I am attempting to make a Tetris clone. The game uses a JTable as a representation of the board. The board is a 2D integer array. I am trying to make it so, when a certain cell has a certain value, the cell will change to a certain color. I...

Matlab - Using symbols in gscatter

colors,symbols,symbol,marker,scatter
Ok, so I'm trying to use gscatter to plot 8 different points in a figure. These 8 points are all different and thus I want to give them different symbols. I know that gscatter will automatically assign them different colors, but I also want to be able to use the...

Changing the colour for a specific hyperlink in html5/CSS

css,html5,colors
I'm really sorry if this is basic stuff- I'm new to html and style sheets and I've googled around for a while, but so far haven't found an answer to my question: I'm writing a single-page website where the subsections have different background colours and I have specified the colours...

What is the word for colorizing grayscale bitmap

algorithm,graphics,colors,bitmap
I have a task of converting grayscale (8 bit, 256 levels of gray) bitmap to a colored one, with the function that looks somewhat like this: function colorize(bmp, colorA, colorB) In the end black pixels become colorA, and black pixels become colorB, and grayscale pixels a mix of A and...