Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. void colorPicker::DrawSquares() {
  2. if (!clicked) return;
  3.  
  4. graphics->DrawRect((int)(m_parent.X() + x - 5), (int)m_Parent.Y() - 5, 282, 232, ::colorBG);
  5. int backup_a = color->a();
  6. for (int column = 0; column < 25; column++) {
  7. for (int row = 0; row < 20; row++) {
  8. int X = static_cast<int>(m_parent.X() + x + column * 10);
  9. int Y = static_cast<int>(m_Parent.Y() + y + row * 10);
  10. Color _color = Color::FromHSV((float)column / 25.f, 1.0f, (float)(row + 5) / 25.f);
  11. if (row == 0) {
  12. _color = Color::FromHSV(float(0.f), 0.f, float(column / 25.f));
  13. }
  14. graphics->DrawRect(X, Y, ::toggleSize, ::toggleSize, _color);
  15. if (ishovered()) {
  16. color->set(_color);
  17. color->a(backup_a);
  18. }
  19. }
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement