question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Color different in android emulator and phone compared to computer browser

See original GitHub issue

Description

I was building a simple new app from scratch using React Native and I did a yarn start and selected android. It built the app and ran it on the android emulator (from the android studio AVD manager). The color on my browser is different from what is being displayed on both the android emulator (in the same computer) and on my android phone.

41a9b513-c841-41b9-b6d9-98ccf2b691f2 The above picture is a screenshot from my computer.

69bef046-ae27-4074-99f1-ccbc6a615fb0 The above picture is a screenshot from my phone.

Here’s a snippet of the CSS

The container class is a style added to the root <view></view> component.

I tried using a simple Hex code as well and the issue still persists.

Any idea as to why this is happening? Please let me know if you need more information.

Version

0.68.1

Output of npx react-native info

info Fetching system and libraries information...
System:
    OS: Linux 5.13 Zorin OS 16
    CPU: (8) x64 Intel(R) Core(TM) i5-8300H CPU @ 2.30GHz
    Memory: 10.37 GB / 15.47 GB
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 16.14.2 - /tmp/yarn--1651418089951-0.9801791225039398/node
    Yarn: 1.22.18 - /tmp/yarn--1651418089951-0.9801791225039398/yarn
    npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm
    Watchman: Not Found
  SDKs:
    Android SDK: Not Found
  IDEs:
    Android Studio: Not Found
  Languages:
    Java: 1.8.0_312 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.1 => 17.0.1 
    react-native: 0.68 => 0.68.1 
  npmGlobalPackages:
    *react-native*: Not Found
Done in 1.92s.

Steps to reproduce

create a new app with a container using the above mentioned color.

yarn start

press a to run the app on an android emulator / phone

Snack, code example, screenshot, or link to a repository

import React from 'react';
import { View, StyleSheet } from 'react-native';

export default function App() {
  return (
    <View style={styles.container} >
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: 'rgba(130, 106, 170, 255)',
    alignItems: 'center',
    justifyContent: 'center',
  }
});

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
cipolleschicommented, May 18, 2022

Issue is not related to React Native, closing it.

1reaction
ProgrammingMuffincommented, May 2, 2022

Like I mentioned, the issue is not related to react-native-size-matters. I understand that having third party libraries may have been confusing. So I have replaced ScaledSheet with StyleSheet and gave it a test again. Issue still persists. I have made the snippet more simpler. Thank you for your reply

Read more comments on GitHub >

github_iconTop Results From Across the Web

why the same color looks different on different android devices
I compare the app in emulator with webpage in the pc browser, and found the same color has huge difference on the same...
Read more >
Color differences, android vs laptop and iphone
Slightly more yellow, as noted above. But it's not just Android - it's everything.
Read more >
Why is the video quality different if I play the same ... - Quora
There are going to be several reasons. First: your phone no doubt has smaller pixels / higher pixel density. This will make the...
Read more >
Emulator vs Simulator – Difference Between Them - Guru99
The emulator/simulator is not able to properly emulate/simulate the exact color display of the devices when the real device is in sunlight or...
Read more >
Testing Color Contrast in Mobile Apps - Deque Systems
In the last few years, iOS and Android have both released a system-wide “Dark Mode” feature. If your app supports Dark Mode, you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found