File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -173,7 +173,10 @@ export default class Advanced extends Component {
173
173
{
174
174
name : 'fadeToColor' ,
175
175
component : (
176
- < FadeToColor onChange = { ( ) => this . props . setBackground ( randomColor ( ) ) } />
176
+ < FadeToColor
177
+ onChange = { ( ) => this . props . setBackground ( randomColor ( ) ) }
178
+ setNone = { ( ) => this . props . setBackground ( "none" ) }
179
+ />
177
180
) ,
178
181
} ,
179
182
{
Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ import { Button } from 'react-native'
3
3
4
4
export default class extends Component {
5
5
render ( ) {
6
- return < Button title = { 'Change color' } onPress = { this . props . onChange } />
6
+ return < >
7
+ < Button title = { 'Change color' } onPress = { this . props . onChange } />
8
+ < Button title = { 'Set "none"' } onPress = { this . props . setNone } />
9
+ </ >
7
10
}
8
11
}
Original file line number Diff line number Diff line change 1
1
export function colorToHex ( c ) {
2
2
if ( c === undefined ) return c
3
+ if ( c === "none" ) return c
3
4
if ( c . includes ( 'rgb' ) ) return rgb2hex ( c )
4
5
if ( c . includes ( '#' ) ) {
5
6
if ( ! isValidHex ( c ) ) throw Error ( 'Invalid color: ' + c )
You can’t perform that action at this time.
0 commit comments