Jetpack Compose Icon's color is switched in real device - icons

Both devices are in dark mode and for some reason the icons in my real device are black in dark mode and all white in light mode.
if I set the color to be white, they stay black in dark mode and if I set the color to be black they stay white in light mode.
Only if I set the color to another color other than plain white or black(for example: Red) the color is applied to the icon.
This is the emulator
This is the real device (Mi 9T Pro)
Edit 1:
It is working as expected on emulator but not on the real device
Implementation
BottomNavigationItem(
icon = {
Icon(
painter = painterResource(
id = screen.icon
),
contentDescription = screen.title,
)
},
selectedContentColor = Color.White,
unselectedContentColor = Color.White.copy(alpha = .3f)
...
)
The result from this code as explain above sets the icons color to white in dark mode and black for light mode in the emulator but it is reversed in the real device, so black for dark mode and white for light mode.

Related

Change focus outline color based on background color

I'm currently working on a navbar (with a dark red background color) where the subsequent submenus have a light grey background color.
I'm using Scss and have managed to get the focus to work with the code bellow:
%focus {
#include focus-style(map-get($colors, "muted"), $focus-offset);
}
The color muted is connected to list of globally defined colors (in this case #636466) and focus-offset pulls the outline in by -2px.
The problem that arises is that there isn't enough contrast between the "muted" outline and the dark red background on the main navbar. I'm wondering how I'd go about adding a white outline when focus is on the main navbar and the "muted" color when it's on the grey submenus?

better dark mode for google translate with dark reader

In light mode, when I hover over a word ( without selecting ), the entire background color of the paragraph turns light blue 👇.
but when I turn on dark mode (using dark reader extension) it is hard to find the hovered paragraph because of poor color contrast.
to make the background color of hovered text blue, I manually add this css code to the "dev tools" of dark reader
.ryNqvb:hover{
background-color: #007FFF;
}
and here's the resault:
but the equivalent english paragraph doesn't changes... I can't find the appropriate class or id to change the inputted text(english one)...
I wanna both paragraph becom blue 👇 what is the solution?

Accessibility issue with text color on dark theme with a light color texture (image) background

I'm on Bootstrap 4 and having a light colour .png image as background of navbar and body, while the footer area is in dark with off-white text colour. The default text colour is black, as the background image is light coloured.
The things get ugly when a user accesses the website on dark theme. The text colour on dark theme gets changed into light colour while the background image remains as light that leaves the text unreadable.
See below the text presentation in light and dark themes:
text on default (light) theme
text on dark theme
Can I keep my text colours unaffected irrespective of the theme of the users? Thanks in advance!
I got it fixed by simply using a transparent texture .png in place of a colour-filled texture .png image as background, with an adjustment in body {background:} colour.

Javafx change color on sliding the slider

I'm trying to create an application where the theme or background color of the application changes on changing the slider position. The color changes within specific range of hex color codes.
For example: In Dark mode of an application, if I move the slider then background color changes to different shades of dark mode either brighter shades or darker shades of dark mode
use the valueProperty() method of the slider call .addListener(observable->{}) and in the {} set the background color according to the getValue() value of the slider. How you convert value to background color is left for u to figure out.

How can I get white on black buttons working in topbar in both iOS7 and iOS6 with Trigger.io?

Using black tint with light_content style:
forge.topbar.removeButtons()
forge.topbar.setStatusBarStyle("light_content")
forge.topbar.setTint([0,0,0,255])
Adding buttons. Images are black on transparent .png's:
{
icon: 'images/info.png'
, tint: [255,255,255,255]
, position: 'right'
}
This works for iOS7, however in iOS6 shows black on a white background within the button. I've tried reversing the image, white on transparent, white on black - and I can't get white on black button images to work on both iOS6 and iOS7.
Is there a way to create the images or specify the forge API calls to get this to work? Or is it a bug in the forge topbar implementation?
This is due to changes in the underlying way iOS 7 displays both the topbar and tabbar. The API provided by Trigger tries to be as close as possible between versions, but it sometimes has to appear differently to support new platform features.
The easiest way to do what you want is to detect iOS 7 and run different code, you can do that as follows:
if (navigator.userAgent.match(/(iPad|iPhone);.*CPU.*OS 7_\d/i) !== null) {
// iOS 7 specific code
} else {
// iOS 6 and lower specific code
}
For white on black buttons (based on white (or black) on transparent png) toggle the tint based on user agent detection provided by Connor:
var tint = (navigator.userAgent.match(/(iPad|iPhone);.*CPU.*OS 7_\d/i) !== null)
? [255,255,255,255]
: [0,0,0,255];
Also, image size for topbar icons should be 44x44 pixels, not 64x64 as may be inferred from the documentation.

Resources