ColorButton::ColorButton(QWidget *parent) : QtColorPicker(parent) { QStringList color_names = ColorBox::colorNames(); for (int i = 0; i < ColorBox::numPredefinedColors(); i++) insertColor(ColorBox::color(i), color_names[i]); for (int i = 0; i < QColorDialog::customCount(); i++) insertColor(QColorDialog::customColor(i), tr("Custom")); connect(this, SIGNAL(colorChanged(const QColor & )), this, SIGNAL(colorChanged())); }
void IndexColorPalette::insertColor(QColor qclr) { KoColor koclr; koclr.fromQColor(qclr); koclr.convertTo(KoColorSpaceRegistry::instance()->lab16()); LabColor clr = *(reinterpret_cast<LabColor*>(koclr.data())); insertColor(clr); }
/*! \internal Copies the color dialog's currently selected item and emits itemSelected(). */ void ColorPickerPopup::getColorFromDialog() { QColor col = QColorDialog::getColor(lastSel, parentWidget()); if (!col.isValid()) return; insertColor(col, tr("Custom"), -1); lastSel = col; emit selected(col); }
/*! \internal Copies the color dialog's currently selected item and emits itemSelected(). */ void ColorPickerPopup::getColorFromDialog() { bool ok; QRgb rgb = QColorDialog::getRgba(lastSel.rgba(), &ok, parentWidget()); if (!ok) return; QColor col = QColor::fromRgba(rgb); insertColor(col, tr("Custom"), -1); lastSel = col; emit selected(col); }
bool KoColorPanel::insertColor( const QColor& color, const QString& toolTip, bool checking ) { if ( checking && isAvailable( color ) ) return false; // Remember the "old" m_nextPosition -- this is the place where the newly // inserted color will be located QRect rect( mapFromPosition( m_nextPosition ) ); insertColor( color, false ); // check only once ;) QToolTip::add( this, rect, toolTip ); return true; }
void IndexColorPalette::insertShades(LabColor clrA, LabColor clrB, int shades) { if(shades == 0) return; qint16 lumaStep = (clrB.L - clrA.L) / (shades+1); qint16 astarStep = (clrB.a - clrA.a) / (shades+1); qint16 bstarStep = (clrB.b - clrA.b) / (shades+1); for(int i = 0; i < shades; ++i) { clrA.L += lumaStep; clrA.a += astarStep; clrA.b += bstarStep; insertColor(clrA); } }
void Radiosity::insertInterpolatedColor(int index, Face *f, Vertex *v) { std::vector<Face*> faces; CollectFacesWithVertex(v,f,faces); double total = 0; Vec3f color = Vec3f(0,0,0); Vec3f normal = f->computeNormal(); for (unsigned int i = 0; i < faces.size(); i++) { Vec3f normal2 = faces[i]->computeNormal(); double area = faces[i]->getArea(); if (normal.Dot3(normal2) < 0.5) continue; assert (area > 0); total += area; color += area * whichVisualization(RENDER_RADIANCE,faces[i],faces[i]->getRadiosityPatchIndex()); } assert (total > 0); color /= total; insertColor(color); }
/*! Makes \a color current. If \a color is not already in the color grid, it is inserted with the text "Custom". This function emits the colorChanged() signal if the new color is valid, and different from the old one. */ void QtColorPicker::setCurrentColor(const QColor &color) { if (col == color || !color.isValid()) return; ColorPickerItem *item = popup->find(color); if (!item) { insertColor(color, tr("Custom")); item = popup->find(color); } col = color; setText(item->text()); dirty = true; popup->hide(); repaint(); item->setSelected(true); emit colorChanged(color); }
void KeyframeLiveMapper::buildColorOctomap(octomap::ColorOcTree& tree,int current_keyframes_size) { int i; octomap::point3d sensor_origin(0,0,0); for(i = 0; i < current_keyframes_size; i++) { const rgbdtools::RGBDKeyframe& keyframe = _keyframes[i]; octomap::pose6d frame_origin; octomap::Pointcloud octomap_cloud; PointCloudXYZRGB::Ptr cloud_unf(new PointCloudXYZRGB()); PointCloudXYZRGB cloud; keyframe.constructDensePointCloud(*cloud_unf, _max_range,_max_stddev); // perform filtering for max z pcl::transformPointCloud(*cloud_unf,*cloud_unf,keyframe.pose); _pass.setInputCloud(cloud_unf); _pass.filter(cloud); pcl::transformPointCloud(cloud,cloud,keyframe.pose.inverse()); // build octomap cloud from pcl cloud frame_origin = octomap::poseTfToOctomap(ccny_rgbd::tfFromEigenAffine(keyframe.pose)); // insert points buildOctoCloud(octomap_cloud,cloud); tree.insertScan(octomap_cloud, sensor_origin, frame_origin); // insert colors insertColor(tree,cloud,keyframe.pose); tree.updateInnerOccupancy(); } }
void Radiosity::Paint(ArgParser *args) { // this offset prevents "z-fighting" bewteen the edges and faces // the edges will always win. glEnable(GL_POLYGON_OFFSET_FILL); glPolygonOffset(1.1,4.0); if (args->render_mode == RENDER_MATERIALS) { // draw the faces with OpenGL lighting, just to understand the geometry // (the GL light has nothing to do with the surfaces that emit light!) for ( int i = 0; i < num_faces; i++) { Face *f = mesh->getFace(i); Material *m = f->getMaterial(); Vec3f a = (*f)[0]->get(); Vec3f b = (*f)[1]->get(); Vec3f c = (*f)[2]->get(); Vec3f d = (*f)[3]->get(); Vec3f normal = f->computeNormal(); glNormal3f(normal.x(),normal.y(),normal.z()); if (!m->hasTextureMap()) { Vec3f color = m->getDiffuseColor(); insertColor(color); glBegin (GL_QUADS); glVertex3f(a.x(),a.y(),a.z()); glVertex3f(b.x(),b.y(),b.z()); glVertex3f(c.x(),c.y(),c.z()); glVertex3f(d.x(),d.y(),d.z()); glEnd(); } else { glEnable(GL_TEXTURE_2D); glColor3f(1,1,1); glBindTexture(GL_TEXTURE_2D,m->getTextureID()); glBegin (GL_QUADS); glTexCoord2d((*f)[0]->get_s(),(*f)[0]->get_t()); glVertex3f(a.x(),a.y(),a.z()); glTexCoord2d((*f)[1]->get_s(),(*f)[1]->get_t()); glVertex3f(b.x(),b.y(),b.z()); glTexCoord2d((*f)[2]->get_s(),(*f)[2]->get_t()); glVertex3f(c.x(),c.y(),c.z()); glTexCoord2d((*f)[3]->get_s(),(*f)[3]->get_t()); glVertex3f(d.x(),d.y(),d.z()); glEnd(); glDisable(GL_TEXTURE_2D); } } } else if (args->render_mode == RENDER_RADIANCE && args->interpolate == true) { // interpolate the radiance values with neighboring faces having the same normal glDisable(GL_LIGHTING); glBegin (GL_QUADS); for ( int i = 0; i < num_faces; i++) { Face *f = mesh->getFace(i); Vec3f a = (*f)[0]->get(); Vec3f b = (*f)[1]->get(); Vec3f c = (*f)[2]->get(); Vec3f d = (*f)[3]->get(); insertInterpolatedColor(i,f,(*f)[0]); glVertex3f(a.x(),a.y(),a.z()); insertInterpolatedColor(i,f,(*f)[1]); glVertex3f(b.x(),b.y(),b.z()); insertInterpolatedColor(i,f,(*f)[2]); glVertex3f(c.x(),c.y(),c.z()); insertInterpolatedColor(i,f,(*f)[3]); glVertex3f(d.x(),d.y(),d.z()); } glEnd(); glEnable(GL_LIGHTING); } else { // for all other visualizations, just render the patch in a uniform color glDisable(GL_LIGHTING); glBegin (GL_QUADS); for ( int i = 0; i < num_faces; i++) { Face *f = mesh->getFace(i); Vec3f color = whichVisualization(args->render_mode,f,i); insertColor(color); Vec3f a = (*f)[0]->get(); Vec3f b = (*f)[1]->get(); Vec3f c = (*f)[2]->get(); Vec3f d = (*f)[3]->get(); glVertex3f(a.x(),a.y(),a.z()); glVertex3f(b.x(),b.y(),b.z()); glVertex3f(c.x(),c.y(),c.z()); glVertex3f(d.x(),d.y(),d.z()); } glEnd(); glEnable(GL_LIGHTING); } if (args->render_mode == RENDER_FORM_FACTORS) { // render the form factors of the patch with the most undistributed light glDisable(GL_LIGHTING); glColor3f(1,0,0); Face *t = mesh->getFace(max_undistributed_patch); glLineWidth(3); glBegin(GL_LINES); Vec3f a = (*t)[0]->get(); Vec3f b = (*t)[1]->get(); Vec3f c = (*t)[2]->get(); Vec3f d = (*t)[3]->get(); glVertex3f(a.x(),a.y(),a.z()); glVertex3f(b.x(),b.y(),b.z()); glVertex3f(b.x(),b.y(),b.z()); glVertex3f(c.x(),c.y(),c.z()); glVertex3f(c.x(),c.y(),c.z()); glVertex3f(d.x(),d.y(),d.z()); glVertex3f(d.x(),d.y(),d.z()); glVertex3f(a.x(),a.y(),a.z()); glEnd(); glEnable(GL_LIGHTING); } glDisable(GL_POLYGON_OFFSET_FILL); HandleGLError(); if (args->wireframe) { mesh->PaintWireframe(); } }
/*! Adds the 17 predefined colors from the Qt namespace. (The names given to the colors, "Black", "White", "Red", etc., are all translatable.) \sa insertColor() */ void QtColorPicker::setStandardColors() { insertColor(Qt::black, tr("Black")); insertColor(Qt::white, tr("White")); insertColor(Qt::red, tr("Red")); insertColor(Qt::darkRed, tr("Dark red")); insertColor(Qt::green, tr("Green")); insertColor(Qt::darkGreen, tr("Dark green")); insertColor(Qt::blue, tr("Blue")); insertColor(Qt::darkBlue, tr("Dark blue")); insertColor(Qt::cyan, tr("Cyan")); insertColor(Qt::darkCyan, tr("Dark cyan")); insertColor(Qt::magenta, tr("Magenta")); insertColor(Qt::darkMagenta, tr("Dark magenta")); insertColor(Qt::yellow, tr("Yellow")); insertColor(Qt::darkYellow, tr("Dark yellow")); insertColor(Qt::gray, tr("Gray")); insertColor(Qt::darkGray, tr("Dark gray")); insertColor(Qt::lightGray, tr("Light gray")); }
void KoColorPanel::dropEvent( QDropEvent* e ) { QColor color; if ( KColorDrag::decode( e, color ) ) insertColor( color ); }
void KoColorPanel::insertDefaultColors() { if ( m_defaultsAdded ) return; m_defaultsAdded = true; int currentRow = m_nextPosition.y; // we have to repaint this row below // Note: No checking for duplicates, so take care when you modify that list insertColor(QColor( 255 , 0 , 0 ), i18n( "color", "Red" ), false); insertColor(QColor( 255 , 165 , 0 ), i18n( "color", "Orange" ), false); insertColor(QColor( 255 , 0 , 255 ), i18n( "color", "Magenta" ), false); insertColor(QColor( 0 , 0 , 255 ), i18n( "color", "Blue" ), false); insertColor(QColor( 0 , 255 , 255 ), i18n( "color", "Cyan" ), false); insertColor(QColor( 0 , 255 , 0 ), i18n( "color", "Green" ), false); insertColor(QColor( 255 , 255 , 0 ), i18n( "color", "Yellow" ), false); insertColor(QColor( 165 , 42 , 42 ), i18n( "color", "Brown" ), false); insertColor(QColor( 139 , 0 , 0 ), i18n( "color", "DarkRed" ), false); insertColor(QColor( 255 , 140 , 0 ), i18n( "color", "DarkOrange" ), false); insertColor(QColor( 139 , 0 , 139 ), i18n( "color", "DarkMagenta" ), false); insertColor(QColor( 0 , 0 , 139 ), i18n( "color", "DarkBlue" ), false); insertColor(QColor( 0 , 139 , 139 ), i18n( "color", "DarkCyan" ), false); insertColor(QColor( 0 , 100 , 0 ), i18n( "color", "DarkGreen" ), false); insertColor(QColor( 130 , 127 , 0 ), i18n( "color", "DarkYellow" ), false); insertColor(QColor( 255 , 255 , 255 ), i18n( "color", "White" ), false); // xgettext:no-c-format insertColor(QColor( 229 , 229 , 229 ), i18n( "color", "Gray 90%" ), false); // xgettext:no-c-format insertColor(QColor( 204 , 204 , 204 ), i18n( "color", "Gray 80%" ), false); // xgettext:no-c-format insertColor(QColor( 178 , 178 , 178 ), i18n( "color", "Gray 70%" ), false); // xgettext:no-c-format insertColor(QColor( 153 , 153 , 153 ), i18n( "color", "Gray 60%" ), false); // xgettext:no-c-format insertColor(QColor( 127 , 127 , 127 ), i18n( "color", "Gray 50%" ), false); // xgettext:no-c-format insertColor(QColor( 102 , 102 , 102 ), i18n( "color", "Gray 40%" ), false); // xgettext:no-c-format insertColor(QColor( 76 , 76 , 76 ), i18n( "color", "Gray 30%" ), false); // xgettext:no-c-format insertColor(QColor( 51 , 51 , 51 ), i18n( "color", "Gray 20%" ), false); // xgettext:no-c-format insertColor(QColor( 25 , 25 , 25 ), i18n( "color", "Gray 10%" ), false); insertColor(QColor( 0 , 0 , 0 ), i18n( "color", "Black" ), false); insertColor(QColor( 255 , 255 , 240 ), i18n( "color", "Ivory" ), false); insertColor(QColor( 255 , 250 , 250 ), i18n( "color", "Snow" ), false); insertColor(QColor( 245 , 255 , 250 ), i18n( "color", "MintCream" ), false); insertColor(QColor( 255 , 250 , 240 ), i18n( "color", "FloralWhite" ), false); insertColor(QColor( 255 , 255 , 224 ), i18n( "color", "LightYellow" ), false); insertColor(QColor( 240 , 255 , 255 ), i18n( "color", "Azure" ), false); insertColor(QColor( 248 , 248 , 255 ), i18n( "color", "GhostWhite" ), false); insertColor(QColor( 240 , 255 , 240 ), i18n( "color", "Honeydew" ), false); insertColor(QColor( 255 , 245 , 238 ), i18n( "color", "Seashell" ), false); insertColor(QColor( 240 , 248 , 255 ), i18n( "color", "AliceBlue" ), false); insertColor(QColor( 255 , 248 , 220 ), i18n( "color", "Cornsilk" ), false); insertColor(QColor( 255 , 240 , 245 ), i18n( "color", "LavenderBlush" ), false); insertColor(QColor( 253 , 245 , 230 ), i18n( "color", "OldLace" ), false); insertColor(QColor( 245 , 245 , 245 ), i18n( "color", "WhiteSmoke" ), false); insertColor(QColor( 255 , 250 , 205 ), i18n( "color", "LemonChiffon" ), false); insertColor(QColor( 224 , 255 , 255 ), i18n( "color", "LightCyan" ), false); insertColor(QColor( 250 , 250 , 210 ), i18n( "color", "LightGoldenrodYellow" ), false); insertColor(QColor( 250 , 240 , 230 ), i18n( "color", "Linen" ), false); insertColor(QColor( 245 , 245 , 220 ), i18n( "color", "Beige" ), false); insertColor(QColor( 255 , 239 , 213 ), i18n( "color", "PapayaWhip" ), false); insertColor(QColor( 255 , 235 , 205 ), i18n( "color", "BlanchedAlmond" ), false); insertColor(QColor( 250 , 235 , 215 ), i18n( "color", "AntiqueWhite" ), false); insertColor(QColor( 255 , 228 , 225 ), i18n( "color", "MistyRose" ), false); insertColor(QColor( 230 , 230 , 250 ), i18n( "color", "Lavender" ), false); insertColor(QColor( 255 , 228 , 196 ), i18n( "color", "Bisque" ), false); insertColor(QColor( 255 , 228 , 181 ), i18n( "color", "Moccasin" ), false); insertColor(QColor( 255 , 222 , 173 ), i18n( "color", "NavajoWhite" ), false); insertColor(QColor( 255 , 218 , 185 ), i18n( "color", "PeachPuff" ), false); insertColor(QColor( 238 , 232 , 170 ), i18n( "color", "PaleGoldenrod" ), false); insertColor(QColor( 245 , 222 , 179 ), i18n( "color", "Wheat" ), false); insertColor(QColor( 220 , 220 , 220 ), i18n( "color", "Gainsboro" ), false); insertColor(QColor( 240 , 230 , 140 ), i18n( "color", "Khaki" ), false); insertColor(QColor( 175 , 238 , 238 ), i18n( "color", "PaleTurquoise" ), false); insertColor(QColor( 255 , 192 , 203 ), i18n( "color", "Pink" ), false); insertColor(QColor( 238 , 221 , 130 ), i18n( "color", "LightGoldenrod" ), false); insertColor(QColor( 211 , 211 , 211 ), i18n( "color", "LightGray" ), false); insertColor(QColor( 255 , 182 , 193 ), i18n( "color", "LightPink" ), false); insertColor(QColor( 176 , 224 , 230 ), i18n( "color", "PowderBlue" ), false); insertColor(QColor( 127 , 255 , 212 ), i18n( "color", "Aquamarine" ), false); insertColor(QColor( 216 , 191 , 216 ), i18n( "color", "Thistle" ), false); insertColor(QColor( 173 , 216 , 230 ), i18n( "color", "LightBlue" ), false); insertColor(QColor( 152 , 251 , 152 ), i18n( "color", "PaleGreen" ), false); insertColor(QColor( 255 , 215 , 0 ), i18n( "color", "Gold" ), false); insertColor(QColor( 173 , 255 , 47 ), i18n( "color", "GreenYellow" ), false); insertColor(QColor( 176 , 196 , 222 ), i18n( "color", "LightSteelBlue" ), false); insertColor(QColor( 144 , 238 , 144 ), i18n( "color", "LightGreen" ), false); insertColor(QColor( 221 , 160 , 221 ), i18n( "color", "Plum" ), false); insertColor(QColor( 190 , 190 , 190 ), i18n( "color", "Gray" ), false); insertColor(QColor( 222 , 184 , 135 ), i18n( "color", "BurlyWood" ), false); insertColor(QColor( 135 , 206 , 250 ), i18n( "color", "LightSkyBlue" ), false); insertColor(QColor( 255 , 160 , 122 ), i18n( "color", "LightSalmon" ), false); insertColor(QColor( 135 , 206 , 235 ), i18n( "color", "SkyBlue" ), false); insertColor(QColor( 210 , 180 , 140 ), i18n( "color", "Tan" ), false); insertColor(QColor( 238 , 130 , 238 ), i18n( "color", "Violet" ), false); insertColor(QColor( 244 , 164 , 96 ), i18n( "color", "SandyBrown" ), false); insertColor(QColor( 233 , 150 , 122 ), i18n( "color", "DarkSalmon" ), false); insertColor(QColor( 189 , 183 , 107 ), i18n( "color", "DarkKhaki" ), false); insertColor(QColor( 127 , 255 , 0 ), i18n( "color", "Chartreuse" ), false); insertColor(QColor( 169 , 169 , 169 ), i18n( "color", "DarkGray" ), false); insertColor(QColor( 124 , 252 , 0 ), i18n( "color", "LawnGreen" ), false); insertColor(QColor( 255 , 105 , 180 ), i18n( "color", "HotPink" ), false); insertColor(QColor( 250 , 128 , 114 ), i18n( "color", "Salmon" ), false); insertColor(QColor( 240 , 128 , 128 ), i18n( "color", "LightCoral" ), false); insertColor(QColor( 64 , 224 , 208 ), i18n( "color", "Turquoise" ), false); insertColor(QColor( 143 , 188 , 143 ), i18n( "color", "DarkSeaGreen" ), false); insertColor(QColor( 218 , 112 , 214 ), i18n( "color", "Orchid" ), false); insertColor(QColor( 102 , 205 , 170 ), i18n( "color", "MediumAquamarine" ), false); insertColor(QColor( 255 , 127 , 80 ), i18n( "color", "Coral" ), false); insertColor(QColor( 154 , 205 , 50 ), i18n( "color", "YellowGreen" ), false); insertColor(QColor( 218 , 165 , 32 ), i18n( "color", "Goldenrod" ), false); insertColor(QColor( 72 , 209 , 204 ), i18n( "color", "MediumTurquoise" ), false); insertColor(QColor( 188 , 143 , 143 ), i18n( "color", "RosyBrown" ), false); insertColor(QColor( 219 , 112 , 147 ), i18n( "color", "PaleVioletRed" ), false); insertColor(QColor( 0 , 250 , 154 ), i18n( "color", "MediumSpringGreen" ), false); insertColor(QColor( 255 , 99 , 71 ), i18n( "color", "Tomato" ), false); insertColor(QColor( 0 , 255 , 127 ), i18n( "color", "SpringGreen" ), false); insertColor(QColor( 205 , 133 , 63 ), i18n( "color", "Peru" ), false); insertColor(QColor( 100 , 149 , 237 ), i18n( "color", "CornflowerBlue" ), false); insertColor(QColor( 132 , 112 , 255 ), i18n( "color", "LightSlateBlue" ), false); insertColor(QColor( 147 , 112 , 219 ), i18n( "color", "MediumPurple" ), false); insertColor(QColor( 186 , 85 , 211 ), i18n( "color", "MediumOrchid" ), false); insertColor(QColor( 95 , 158 , 160 ), i18n( "color", "CadetBlue" ), false); insertColor(QColor( 0 , 206 , 209 ), i18n( "color", "DarkTurquoise" ), false); insertColor(QColor( 0 , 191 , 255 ), i18n( "color", "DeepSkyBlue" ), false); insertColor(QColor( 119 , 136 , 153 ), i18n( "color", "LightSlateGray" ), false); insertColor(QColor( 184 , 134 , 11 ), i18n( "color", "DarkGoldenrod" ), false); insertColor(QColor( 123 , 104 , 238 ), i18n( "color", "MediumSlateBlue" ), false); insertColor(QColor( 205 , 92 , 92 ), i18n( "color", "IndianRed" ), false); insertColor(QColor( 210 , 105 , 30 ), i18n( "color", "Chocolate" ), false); insertColor(QColor( 60 , 179 , 113 ), i18n( "color", "MediumSeaGreen" ), false); insertColor(QColor( 50 , 205 , 50 ), i18n( "color", "LimeGreen" ), false); insertColor(QColor( 32 , 178 , 170 ), i18n( "color", "LightSeaGreen" ), false); insertColor(QColor( 112 , 128 , 144 ), i18n( "color", "SlateGray" ), false); insertColor(QColor( 30 , 144 , 255 ), i18n( "color", "DodgerBlue" ), false); insertColor(QColor( 255 , 69 , 0 ), i18n( "color", "OrangeRed" ), false); insertColor(QColor( 255 , 20 , 147 ), i18n( "color", "DeepPink" ), false); insertColor(QColor( 70 , 130 , 180 ), i18n( "color", "SteelBlue" ), false); insertColor(QColor( 106 , 90 , 205 ), i18n( "color", "SlateBlue" ), false); insertColor(QColor( 107 , 142 , 35 ), i18n( "color", "OliveDrab" ), false); insertColor(QColor( 65 , 105 , 225 ), i18n( "color", "RoyalBlue" ), false); insertColor(QColor( 208 , 32 , 144 ), i18n( "color", "VioletRed" ), false); insertColor(QColor( 153 , 50 , 204 ), i18n( "color", "DarkOrchid" ), false); insertColor(QColor( 160 , 32 , 240 ), i18n( "color", "Purple" ), false); insertColor(QColor( 105 , 105 , 105 ), i18n( "color", "DimGray" ), false); insertColor(QColor( 138 , 43 , 226 ), i18n( "color", "BlueViolet" ), false); insertColor(QColor( 160 , 82 , 45 ), i18n( "color", "Sienna" ), false); insertColor(QColor( 199 , 21 , 133 ), i18n( "color", "MediumVioletRed" ), false); insertColor(QColor( 176 , 48 , 96 ), i18n( "color", "Maroon" ), false); insertColor(QColor( 46 , 139 , 87 ), i18n( "color", "SeaGreen" ), false); insertColor(QColor( 85 , 107 , 47 ), i18n( "color", "DarkOliveGreen" ), false); insertColor(QColor( 34 , 139 , 34 ), i18n( "color", "ForestGreen" ), false); insertColor(QColor( 139 , 69 , 19 ), i18n( "color", "SaddleBrown" ), false); insertColor(QColor( 148 , 0 , 211 ), i18n( "color", "DarkViolet" ), false); insertColor(QColor( 178 , 34 , 34 ), i18n( "color", "FireBrick" ), false); insertColor(QColor( 72 , 61 , 139 ), i18n( "color", "DarkSlateBlue" ), false); insertColor(QColor( 47 , 79 , 79 ), i18n( "color", "DarkSlateGray" ), false); insertColor(QColor( 25 , 25 , 112 ), i18n( "color", "MidnightBlue" ), false); insertColor(QColor( 0 , 0 , 205 ), i18n( "color", "MediumBlue" ), false); insertColor(QColor( 0 , 0 , 128 ), i18n( "color", "Navy" ), false); finalizeInsertion( m_nextPosition ); // with a no-op paint() call as we repaint anyway updateGeometry(); // we have to repaint the "old" current row explicitly due // to WStaticContents update( 0, currentRow << 4, COLS << 4, 16 ); }
void KoColorPanel::insertColor( const QColor& color, const QString& toolTip ) { Position pos = m_nextPosition; if ( insertColor( color, toolTip, true ) ) // we want checking for external users finalizeInsertion( pos ); }