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

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.

  1. Yes, you should get exactly the color code you put in and it should be consistent everywhere.

  2. It will look different on different display technologies, but that can’t be controlled by Corona.

3.  That said, when you take a screenshot on your mac and inspect the color it should be the same encoding as you put in.

I think you have made a mistake or found a really weird bug.

Note:  I did this on Windows 10 in the simulator using build: 2017.3160. 

local tmp = display.newRect( 100, 100, 100, 100 ) tmp:setFillColor( 46/255, 231/255, 136/255)

Then I took a screenshot and examined the color.

I got color code “#2ee788” which is the color code you specified.

Please try just those two lines of code in main.lua (no other code) and verify you’re not getting the right color.

If you are not, please post back the screenshot here.

I just re-ran this on my old MBP running OSX 10.11.6 and using an older version of Corona (2017.3114) and I get the same results.
 
(Please ignore buttons; I ran this test on top of a plugin test I’m writing for a remote app patching plugin I’m finishing up.)
 
win10_2017.3160.png
 
osx10.11.6_2017.3114.png

 The picture you can tell the visual difference and to verify I took the dropper tool to check the color code. The I essential got the exact same code for the green that I wanted (left) except the green was (231+1)/255 and green I received (right) had the RGB code that I stated at the beginning of the post.

It appears that I do not know how to attach images but what I did was put the code for the green I wanted in paint and sat it next to the green I received in corona. Then I took a screen shot of the two together and tested their RGB with the color selector (looks like a dropper) in a paint.

Huh?  I couldn’t understand what you just said.  You are missing words in those sentences or something. 

Please make your posts more legible so they can be understood.  Communication is key to getting help.   

Tip: After clicking ‘Post’ I suggest you read your post.  Then, if you find typos, missing words, etc. re-edit the post and fix the issues. 

(I do this for every question and answer I post.)

Now, back to your latest post…

Are you telling me that you ran the code I pasted (as the ONLY code in a small project) and the colors come out incorrectly?

If so, you probably have an issue with your computer.  Also, you still haven’t told me any details about your system…

  • OS Version - What exact OS and version are you running the simulator in?
    • Ex: I’m running Windows 10 and OS X OSX 10.11.6 on my PC and Mac respectively.
  • Hardware - What machine are you running on Make and model.
    • I ask this because knowing the hardware can help with graphics questions.  
    • Macs are consistent and knowing the make, model, and year we can figure this out details like the video card, etc.
    • For PC’s this is a little harder.
    • I’m running an older self-built machine (full details posted in this thread for another topic) The important detail in this discussion is the video card and driver version: GeForce GTX970 ; Driver 382.05
    • I tested on my PC and my Mac (Gen 1 MBP 17") without any issue.
  • Corona Version - What version of Corona are you running?
    • Finally, whenever you post about a supposed bug or oddity, be sure to tell us what version of Corona you’re using. 
    • Corona is updated almost daily and knowing the version you’re running is critical to helping you.

Let  me do this.  Give me a few minutes and I’ll post a link to a sample project. 

With that project I’ll give you some instructions.

You can then run it and tell me what the project reports here in the forums.  OK?

Back in a bit.

PS - Meanwhile, consider the points I made above about legibility and posting all the details we need to help you. 

-Thanks!

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.