Beispiel #1
0
int MainWindow::setColorRGB (const QString& address, int r, int g, int b) {
  auto it = m_connectedRobots.find(address);
  if (m_connectedRobots.end() == it) {
    qDebug() << "(barobolab) ERROR: setColorRGB on disconnected " << address << '\n';
    return -1;
  }
  return Mobot_setColorRGB(it->second, r, g, b);
}
void on_colorDialog_color_set(GtkColorButton* w, gpointer data)
{
  mobot_t* mobot = (mobot_t*)data;
  GdkColor color;
  gtk_color_button_get_color(w, &color);
  int rgb[3];
  rgb[0] = color.red/(256);
  rgb[1] = color.green/(256);
  rgb[2] = color.blue/(256);
  Mobot_setColorRGB(mobot, rgb[0], rgb[1], rgb[2]);
}