RGB in simulator provides an off color. (Not a question about changing values to 0-1)

Sorry on the first version of this post. I was having a conversation while typing and words began to find their way in.

  1. I picked a color that I liked on paint and put its RGB code into Corona.

  2. I put the color that I received in paint and put it next to the color I received in Corona.

  3. I took a screenshot of the two colors and reoponed the screenshot in paint.

  4. With paint’s color select tool, I compared the RGB codes for each color and came up with the values I previously posted.

 

The light green I wanted (46/255, 231/255, 136/255)

The hulk green it gave me (36/255, 231/255, 112/255)

Here is a tool to help you test your system.

https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2017/10/colorWoes.zip

Watch video first, then download and run tool in simulator.

https://www.youtube.com/watch?v=fa74zJ35MMk&feature=youtu.be

PS - On a side note, this tool was written in fewer than 100 lines of code (after subtracting comments and blanks) w/ SSK2 goodness.  Corona Rocks, but Corona SSK2 rocks a little bit more. :slight_smile:

PPS - I just picked up on the use of ‘Hulk’ in describing the color.  Nice and funny. :slight_smile:

Hey.  You said, you’re taking a screenshot of Corona right?

Have you tried:

  1. Painting a rectangle in Paint,

  2. Taking a screenshot of Paint, 

  3. Pasting that back to Paint, and finally… 

  4. Sampling the color you captured? 

It could be something wonky in the screen capture and if you get a bad result doing this, you’ll be able to verify the screen capture is the issue.

Just an idea…

I really appreciate all the effort you put into helping me especially since my post was poorly constructed with typos and missing information. 

I saw the video and tried out the app but unfortunately, the colors still differ. I understand if you cannot help me beyond this point and I will take the necessary steps that you listed at the end of your video. Just for some closure: I am running macOS Sierra on a late 2013 macbook pro. Corona Version 2016.2992 (2016.11.10). It could very well be an issue with PaintBrush which is the application I was using to figure out RGB code.

Thanks again!

–code cut from my project

local redG = 46/255

local greenG = 231/255

local blueG = 136/255

borderB = display.newRect(display.contentWidth/2, 200, display.contentWidth, 40)

borderB:setFillColor(redG,greenG,blueG)

I will perhaps try inserting the colored image into my project like you suggested.

1. You should run a recent version of Corona.  That is very old.

  1. You said ‘…but unfortunately, the colors still differ…’.    That wasn’t clear to me.

Do you mean, the tool I wrote for you ran and said the colors didn’t match?  Or do you mean the colors didn’t look as expected on your screen / screen-capture?  (My tool wasn’t meant to solve your screen capture issues.)

If the TOOL complained, then you’ve got an issue that needs further exploration.  

If the colors look wrong, I think you’ve simply got a problem with your computer, software, or drivers.

  1. I’d use a better free app app like Gimp.  https://www.gimp.org/

I believe that Corona is not a color managed system and uses the sRGB color space. It’s possible that you maybe viewing your expected color swatches in a color managed environment (some browsers use color management). 

Rob

Sorry, for my unclearness. Your tool said that the color I was viewing was correct. However, the paint application I was using to said that the color was a different RGB value. I am starting to think that the issue may be with the paint application that I am using to check the RGB values and not Corona SDK.

"I believe that Corona is not a color managed system and uses the sRGB color space. It’s possible that you maybe viewing your expected color swatches in a color managed environment (some browsers use color management). " I do not know what this means.

I picked up Corona as a hobby and most of programming/design knowledge is from my Electrical Engineering courses. I apologize for my novice knowledge.

I think this discussion is going around in circles a bit and will never resolve without ensuring there are no issues in your dev environment.

Also, do you have another computer to work on or a friend’s computer to test this on?  If so, you should do so.  I think this will help allay your worries.

I am sure you’ve got an issue with your computer, software, and/or drivers.

I have never heard of anyone having a problem with colors not matching the color code without it being one of those issues.

You started this thread because you were worried your colors would not be ‘true’ when published on mobile devices.  This simply is not  going to happen.  There are way too many published Corona apps individually and through pro-publishing houses for this to be a thing.  Someone would have noticed.

My advise to you is to focus on resolving the issue with your dev environment.

  • Update your OS if you can.
  • Update your drivers if you can.
  • Unfortunately, your rig is kind of dated and may have a driver issue. :frowning:
    • ​This is not meant to be insulting.  My Mac rig is positively ancient (older than yours).
  • Update to latest Corona (as previously suggested).
  • Use a more standard art app like Gimp or better yet Photoshop.
  • Be sure you don’t have some app running on your computer that is messing you up. 

re: Color Management System - Did you read up on this before posting back?  It is fine not to know what it is.  It is also cool asking for a simplified description of it (although you may not get one).  However, you have the whole web and Google.  

Thanks for the help guys. I appreciate it.

One last set of questions for you.

  1. Did you download those images I posted above?  If so, what color does your Paint tool tell you I’m using for the green blocks.

I used your color code so it should match.

  1. I’m really concerned that the app you’re using may be the culprit in all this.  Have you tried Gimp or some alternate app yet?

  2. Just to be clear, when you capture the screen are you using the OSX capture or something from an app?  ie. Command-Shift-4 or one of those OSX capture strokes, versus some app.

  3. Have you tried directly sampling the color in the simulator?

https://colorsnapper.com/

I should also point out that mobile devices are not color managed very well either.  You can sit phone A by phone B and phone B might have a clear blue color shift while phone A is shifted towards yellow. Apple now has a night mode (Android may have the same) where they shift the colors to more yellow tones to mimic household lighting because the daylight balanced devices emit a lot of blue which throws some people’s ability to sleep off.

To try and guarantee that any one RGB color value will render the same across every device simply isn’t realistic.

Rob

Picture 1: I went ahead and took a screenshot of the code you wanted me to test.
 
Picture 2: Then I opened it up in Gimp and checked the RGB code for the circle.
 
Picture 3: I wanted to check the colors of the two photos you sent me. Picture 3 is the one called “win10_2017…”
 
Picture 4: The one called “oscx10…”

Edit: I am using the application Grab to take screenshots. I believed it came installed onto the computer.

Pictures 1, 2, 3, 4

As an experiment I took this page, loaded it into Firefox (I mostly use Chrome for Corona work) where I have the Colorzilla color tool and measured all of the images. From Top to Bottom (and left to right), here are the color values that Firefox saw (which is using color management)

36, 233, 113

20, 235, 138

45, 232, 141

61, 231, 136

These colors are all off by a touch from what your color picker is reporting. I took the first image and brought it into Adobe Photoshop. I checked and it’s an “Unmanaged RGB” image. That is there is no color profile for software to know how to render the colors. I did a couple of tests, assigning to an sRGB profile and converting it to an sRGB profile. In each case the colors rendered even differently, then I noticed something **REALLY** odd.  As I moved the Photoshop color info picker around the green square, the colors were changing, it was a little shift but all around the 35-36, 232-233, 112-113 range. Perhaps in making the screen shot, that tool was having trouble deciding what colors were used. If this were a JPEG I might understand this because of how JPEG compression works, but for a PNG file, the color should be constant across the block.

Now when looking at Unmanaged RGB files in a browser, it should default to the smallest but common color space sRGB, but the browsers may look at them differently.

But as I mentioned above slight color shifts are going to happen from screen to screen. 

Rob

Yay, most the issue arose because you can distinctly tell the color difference. I wanted to show the photos before but I am too incompetent on how to use a forum. I understand that multiple screen captures will slightly warp the colors.

On the photo, the colors on the split on the left and right are the colors I expected and the top and button are the colors I got instead. 

To be completely honest I feel awful for dragging you guys through this. You have done a lot of work to help me out and I understand if you no longer want to commit the effort.

It’s not that we don’t want to help you out. If that’s the case @roaminggamer wouldn’t still be asking questions and I wouldn’t have dug into your images to look at what’s going on.

But we have a saying in our house: “Learn to pick your battles”. I’m also a photographer and getting the “right” colors is important, but there are books on Color Management. There are tools to calibrate your monitor. It’s a really complex thing, but the Mac screen you are looking at and the Mac screen I’m looking at are 99.9% likely to be rendering colors differently, since I have gone through and tried to calibrate my screen. When I plugin in my external monitor, colors will be different on the MacBook Pro screen and the LG monitor, even though I’ve followed the Mac calibration closely. I guess the point I’m trying to make, is this isn’t a battle you’re going to win because you are not in control of where your app will be viewed.  

Consider the simulator an approximation. Install on real devices to see what you’re more likely to see even though your device and my device are still going to be a bit different.

Rob

I downloaded your images and inspected them.  I noticed two things.

  1. When I inspected them in PaintShop Pro X2 (my tool of choice), none of the color codes matched those you show.

  2. Moving the dropper over the green blocks would show slight deviations in the rgb value.  i.e. Not every pixel in the colored block is the same color.

This tells me that the screen capture itself is corrupting the color in the images.  So, I don’t think you have anything to worry about.

My app tells you the graphics card thinks the color matches the color you’re selecting so you’re good to go, regardless of how a screenshot looks.

-Ed

PS - I am definitely interested in helping you, but I think in this case the problem is something that can’t be resolved.  i.e. Getting the screenshots to perfectly reflect the color you’re using. 

Keep on coding and be sure to post a new thread/question if you run into difficulties in your game making travels.  I’ll be around.

I think there an important lesson in this thread however…

Never sign off on a game or app till you see it on the device.  You may be very disappointed by the result if you’ve been seeing something slightly different on your PC.

I’ve said this before (elsewhere), but at the end of the day, the only true representation of your game’s look, feel, performance, etc. will be on test devices.  So test on a lot of devices before publishing.

Once again, thanks! I greatly appreciate the effort you guys put in. Good day to both of you.