Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
react-native-easing-gradient
Advanced tools
Create smooth gradients in React Native
From https://larsenwork.com/easing-gradients/
Linear gradients often have hard edges where they start and/or end. We can avoid those by controlling the color mix with easing functions.
import { LinearGradient } from 'expo-linear-gradient'
import { easeGradient } from 'react-native-easing-gradient'
const { colors, locations } = easeGradient({
colorStops: {
0: {
color: 'transparent',
},
1: {
color: '#18181B',
},
},
})
function App() {
return (
<View style={styles.container}>
<LinearGradient
colors={colors}
locations={locations}
style={styles.overlay}
/>
</View>
)
}
You can also change the easing functions between the color stops
const { colors, locations } = easeGradient({
colorStops: {
0: {
color: 'transparent',
// This color stop will now use `Easing.linear` instead of `Easing.ease`
easing: Easing.linear,
},
1: {
color: '#18181B',
},
},
// The easing function used on all color stops, defaults to `ease-in-out` (Easing.bezier(0.42, 0, 0.58, 1))
easing: Easing.ease,
})
Or the amount of extra color stops added between each transition
const { colors, locations } = easeGradient({
colorStops: {
0: {
color: 'transparent',
},
1: {
color: '#18181B',
},
},
// The more color stops added, the smoother the transition is
// Defaults to 12
extraColorStopsPerTransition: 16
})
To run the example project, follow these steps:
yarn
cd example
yarn && yarn start
FAQs
Create smooth gradients in React Native
The npm package react-native-easing-gradient receives a total of 1,359 weekly downloads. As such, react-native-easing-gradient popularity was classified as popular.
We found that react-native-easing-gradient demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.