You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
696 B
16 lines
696 B
layout(key) in bool primaryColors;
|
|
layout(ctype=SkPMColor4f, when=primaryColors) in uniform half4 colorGreen, colorRed;
|
|
layout(ctype=SkPMColor4f, when=!primaryColors) in uniform half4 colorOrange, colorPurple;
|
|
|
|
half4 main() {
|
|
half4 green = primaryColors ? colorGreen : colorOrange;
|
|
half4 red = primaryColors ? colorRed : colorPurple;
|
|
bool t = true;
|
|
bool f = false;
|
|
|
|
return half4(t ? green.r : red.r, // true -> green.r
|
|
f ? red.g : green.g, // false -> green.g
|
|
(green.g == red.r) ? green.b : red.r, // true -> green.b
|
|
(green.a != red.a) ? red.g : green.a); // false -> green.a
|
|
}
|