Skip to content

Commit

Permalink
Update src/sdl_utils.h
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingranade authored Apr 14, 2020
1 parent 60d6458 commit aaf0ff7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/sdl_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ inline SDL_Color color_pixel_sepia( const SDL_Color &color )
const Uint8 av = average_pixel_color( color );
const float gammav = 1.6;
const float pv = av / 255.0;
const Uint8 finalv = std::min( std::round( std::pow( pv, gammav ) * 150 ), 100.0 );
const Uint8 finalv =
std::min( static_cast<int>( std::round( std::pow( pv, gammav ) * 150 ) ), 100 );

return mix_colors( sepia_dark, sepia_light, finalv );
}
Expand Down

0 comments on commit aaf0ff7

Please sign in to comment.