-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
With Date Range, lighter color not applied on days between the range #85
Comments
I've been experiencing this issue too, specifically when I set the primary color in theme to "#5F53FC", a lighter color connecting the two dates does not show up for me. |
@chakrihacker @RichardLindhout @nandorojo Any guidance you can give us on this would be fantastic. |
Can you share a code snippet that I can try locally |
I only tested this on the iPhone simulator, it should at least demonstrate the issue at hand. (https://snack.expo.dev/2IrVHMYvU) |
@iM-GeeKy thanks for taking the time to setup the snack example and demonstrate the issue we're facing here. Much appreciated. @chakrihacker, if you look at @iM-GeeKy 's example project, when selecting a range there is no light-blue highlight between the date ranges; you'll notice he specified a primary color in the react-native-paper theme. But as soon as you delete that custom primary color, the light purple highlight works! |
@mashaalmemon and @iM-GeeKy test my branch and verify if it's working or not? |
@chakrihacker I tried your branch and it didn't seem to resolve the issue. As a sanity check, are you (@mashaalmemon) seeing the same behavior? |
I already merged it but haven't tested it yet, if somebody has a fix I'll merge it into main |
How did you test my branch? |
In one of my private repositories I pointed to your branch in my package.json, deleted node_modules, and did a fresh install. I will add that I think the fix did help to a degree, but for lighter colors (ie. #2979FF, #5F53FC) the highlight is so faint it appears almost white. Thanks for the quick response times! Perhaps the ratio in your changes needs to be tweaked to accommodate for lighter hues. |
I think we can introduce a prop for the user to set the ratio of color lightness, right now it's 90% lightness of the primary color, so It depends on the primary color. Having hardcoded values might not be the best way. What are your thoughts @RichardLindhout ? |
checking if it's light or dark I think there is something in the color for that or in the react-native-paper codebase already |
I don't know if anything is written on it in the Material Design Spec |
I just submitted a pr for the new rangeOpacity prop that I added in my branch. Please let me know if it works for you all. |
I think we should check the darkness of the primary color to use different opacties if color is dark |
But not let the user set it since it'll be extra work for the library user |
Let me give a try tweaking different colors |
What do you think of this approach of tint color @RichardLindhout ? https://codesandbox.io/s/friendly-brattain-s1n7z?file=/src/App.js |
I think it's good but it has to take in account the following things |
Is that not what @chakrihacker is mocking with his demo above? Where "Tinted Color" would correspond to dark theme color and so on... |
Any solution? I'm facing the same issue. Selected range color is dark as it should be light and selected dates behind the selected range is hiding.
|
@SharfMohiuddin PR's are welcome! As a temporary fix you can always create a patch using |
I'm running into this same issue. When I override the theme.colors.primary default value I'm missing the tinted background for the dates between start and end. Has anybody found a reliable solution? |
We're using react-native-paper in our project and have a custom theme.
We're finding that:
Is there another color we have to specify in the react-native-paper theme to get this working right?
The text was updated successfully, but these errors were encountered: