Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/color improvements #181

Merged
merged 9 commits into from
Oct 22, 2020
Merged
Prev Previous commit
Next Next commit
Fix color picker, renamed functions
  • Loading branch information
Giwayume committed Oct 22, 2020
commit 4db10f1e5ac993d6ca14a06cbcf2e11f368fcf46
7 changes: 3 additions & 4 deletions src/js/tools/pick_color.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,13 @@ class Pick_color_class extends Base_tools_class {
//find color
var c = ctx.getImageData(mouse.x, mouse.y, 1, 1).data;
var hex = this.Helper.rgbToHex(c[0], c[1], c[2]);
this.Base_gui.GUI_colors.change_color(hex);

const newColorDefinition = { hex };
if (c[3] > 0) {
//set alpha
this.Base_gui.GUI_colors.change_alpha(c[3]);
newColorDefinition.a = c[3];
}

this.Base_gui.GUI_colors.render_colors();
this.Base_gui.GUI_colors.set_color(newColorDefinition);
}

}
Expand Down