|
Author |
Topic: -16711935 = green? (Read 467 times) |
|
mFredy
|
-16711935 = green?
« on: Jan 8th, 2005, 10:56pm » |
|
Greetings, I got this from calling pixels[]. Why is -16711935 green? Is this a hexadecimal number? If so, what is red, green, blue in it? ... if not, then what is it, and how can I convert it into a hexadecimal number?
|
« Last Edit: Jan 8th, 2005, 10:59pm by mFredy » |
|
|
|
|
mFredy
|
Re: -16711935 = green?
« Reply #1 on: Jan 9th, 2005, 1:07am » |
|
Alright I got some help from a friend, jbum at flashkit.com, and the Windows scientific calculator. The decimal -16711935 = 0xFF00FF01 = green is there a way to get a hex value instead of a decimal? Here's the code I'm working with: ___________________________ BImage a; size(50, 50); framerate(30); a = loadImage("images/chuck_small.jpg"); image(a, 0, 0); String pixel = ""; for(int i=0; i<width*height; i++) { pixel += a.pixels[i]; } String list[] = splitStrings(pixel); saveStrings("text/pixels.txt", list); ___________________________ I'v tried using colorMode() also with no luck. Why are the colors written as negatives?
|
« Last Edit: Jan 9th, 2005, 2:03am by mFredy » |
|
|
|
|
TomC
|
Re: -16711935 = green?
« Reply #3 on: Jan 9th, 2005, 3:00pm » |
|
on Jan 9th, 2005, 3:07am, fjen wrote:tom, the color question seems to come up quite often, maybe that's something for your faq as well |
| Noted, but I'm concentrating on the questions most often asked about Java syntax and libraries - the Processing team can deal with questions about their own syntax and libraries (Could/should the color type be formatted as hex by default)
|
|
|
|
fjen
|
Re: -16711935 = green?
« Reply #4 on: Jan 9th, 2005, 3:27pm » |
|
right ... why did i think it's a java question in the first place? hmmm. java isn't even ARGB .. tsss. florian! /F ---- no .. looking at it from a beginners point of view hex is not really naturally understood. the only reason to use it would be since many people have used it in html or else before. but many didn't.
|
« Last Edit: Jan 9th, 2005, 3:33pm by fjen » |
|
|
|
|
mFredy
|
Re: -16711935 = green?
« Reply #5 on: Jan 9th, 2005, 11:19pm » |
|
Thanks for the help.
|
|
|
|
|