{"size": 514, "ext": "js", "max_stars_repo_path": "shaders/overlay.js", "max_stars_repo_name": "ravana69/looper", "max_stars_repo_stars_event_min_datetime": "2018-03-07T00:10:23.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-27T23:13:30.000Z", "max_issues_repo_path": "shaders/overlay.js", "max_issues_repo_name": "a-gran/looper", "max_issues_repo_issues_event_min_datetime": "2018-04-12T20:55:41.000Z", "max_issues_repo_issues_event_max_datetime": "2021-02-04T11:48:29.000Z", "max_forks_repo_path": "shaders/overlay.js", "max_forks_repo_name": "a-gran/looper", "max_forks_repo_forks_event_min_datetime": "2018-03-12T02:19:15.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-04T10:46:32.000Z"}
{"max_stars_count": 892, "max_issues_count": 5, "max_forks_count": 93, "avg_line_length": 27.0526315789, "max_line_length": 90, "alphanum_fraction": 0.6381322957}
const overlay = `
float applyOverlayToChannel( float base, float blend ) {
  return (base < 0.5 ? (2.0 * base * blend) : (1.0 - 2.0 * (1.0 - base) * (1.0 - blend)));
}

vec4 overlay(vec4 base, vec4 blend, float opacity) {
  vec4 color = vec4(
    applyOverlayToChannel( base.r, blend.r ),
    applyOverlayToChannel( base.g, blend.g ),
    applyOverlayToChannel( base.b, blend.b ),
    applyOverlayToChannel( base.a, blend.a )
  );
  return color * opacity + base * ( 1. - opacity );
}

`;

export default overlay;
