1/*
2 * Copyright 2018 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8layout(ctype=SkPMColor) in half4 color0;
9layout(ctype=SkPMColor) in half4 color1;
10layout(ctype=SkPMColor) in half4 color2;
11layout(ctype=SkPMColor) in half4 color3;
12layout(ctype=SkPMColor) in half4 color4;
13layout(ctype=SkPMColor) in half4 color5;
14
15void main() {
16    half alpha = 255.0 * sk_InColor.a;
17    if (alpha < 0.5) {
18        sk_OutColor = color0;
19    } else if (alpha < 1.5) {
20        sk_OutColor = color1;
21    } else if (alpha < 2.5) {
22        sk_OutColor = color2;
23    } else if (alpha < 3.5) {
24        sk_OutColor = color3;
25    } else if (alpha < 4.5) {
26        sk_OutColor = color4;
27    } else {
28        sk_OutColor = color5;
29    }
30}