Getting color selectors working
This commit is contained in:
parent
60c12ce150
commit
2c76741c9b
8 changed files with 242 additions and 189 deletions
|
|
@ -52,9 +52,9 @@ template <typename T> void color_button(GUIManager& gui, const char* id, T* val,
|
|||
d.innerContent = [&] (const SelectableButton::InnerContentCallbackParameters&) {
|
||||
gui.element<ColorRectangleDisplay>("color display", [val, hasAlpha = options.hasAlpha] {
|
||||
if(hasAlpha)
|
||||
return SkColor4f{(*val)[0], (*val)[1], (*val)[2], 1.0f};
|
||||
else
|
||||
return SkColor4f{(*val)[0], (*val)[1], (*val)[2], (*val)[3]};
|
||||
else
|
||||
return SkColor4f{(*val)[0], (*val)[1], (*val)[2], 1.0f};
|
||||
});
|
||||
};
|
||||
CLAY_AUTO_ID({.layout = {.sizing = {.width = CLAY_SIZING_FIXED(options.size), .height = CLAY_SIZING_FIXED(options.size) } } }) {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ vec4 main(vec2 fragcoord) {
|
|||
vec4 alphaBoard1 = vec4(0.2, 0.2, 0.2, 1.0);
|
||||
vec4 alphaBoard2 = vec4(0.8, 0.8, 0.8, 1.0);
|
||||
|
||||
vec2 flooredCoords = floor(fragcoord / 10);
|
||||
vec2 flooredCoords = floor(fragcoord / 5);
|
||||
bool isDark = mod(flooredCoords.x + flooredCoords.y, 2.0) > 0.5;
|
||||
|
||||
return isDark ? alphaBoard2 : alphaBoard1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue