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

Alright, so basically I am picky when it comes to consistency. I have two colors that I picked out, and when I put them into the simulator, I received a similar color but not the same. My question is will the colors be right when I install it on to a phone? Is this just a problem with the simulator?

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

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

Sorry if this is a dumb question. I have an apple (computer and phone) so it isnt the easiest thing to put the game on my phone ($100 license fee).

  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.  

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