Create a new movie like the makeSunsetMovie method that turns the beach black after the blue and green is reduced by a passed amount.
What will be an ideal response?
```
/? ?
? Method t o s l o w l y c r e a t e a s u n s e t and a f t e r
? a c e r t a i n amount o f r e d u c t i o n make t h e p i c t u r e f a d e
? to black
? @param d i r e c t o r y t h e d i r e c t o r y t o w r i t e t o
?/
public void makeSunsetMovie2 ( S t r i n g d i r e c t o r y , double t h r e s h o l d )
{
// l o a d t h e p i c t u r e o f t h e b e a c h
S t r i n g fName = F i l e C h o o s e r . getMediaPath ( ” beach?s m a l l e r . j p g ” ) ;
P i c t u r e beachP = new P i c t u r e ( fName ) ;
double amountReduction = 1 ;
P i c t u r e blackP = new P i c t u r e ( beachP . getWidth ( ) , beachP . g e t H e i g h t ( ) ,
C o l o r .BLACK) ;
// d e c l a r e o t h e r v a r i a b l e s
P i c t u r e temp = null ;
FrameSequencer f r a m e S e q u e n c e r =
new FrameSequencer ( d i r e c t o r y ) ;
int framesPerSec = 3 0 ;
// l o o p c r e a t i n g t h e frames
f o r ( i n t i = 0 ; i < f r a m e s P e r S e c ; i ++)
{
Encoding, Manipulating, and Creating Movies
temp = new P i c t u r e ( beachP ) ;
amountReduction = amountReduction ? 0 . 9 5 ;
i f ( amountReduction < t h r e s h o l d )
{
temp . modifyTowards ( blackP , i , f r a m e s P e r S e c ) ;
}
else
{
temp . makeSunset ( amountReduction ) ;
}
f r a m e S e q u e n c e r . addFrame ( temp ) ;
}
// p l a y t h e movie
frameSequencer . play ( framesPerSec ) ;
}
```