Validate color selection and destroy dialog.
195244
def ok(self):
        """"""
        rgb, hsv, hexa = self.square.get()
        if self.alpha_channel:
            hexa = self.hexa.get()
            rgb += (self.alpha.get(),)
        self.color = rgb, hsv, hexa
        self.destroy()
913988
function () {
      if (!selection.isSelected()) {
        return;
      }
      highlight.off();
      priv.currentBorder.disappear();
      if (autofill.handle) {
        autofill.hideHandle();
      }
      selection.end(false);
      editproxy.destroy();
      self.rootElement.triggerHandler('deselect.handsontable');
    }
860006
def OnCellBackgroundColor(self, event):
        """"""

        with undo.group(_("Background color")):
            self.grid.actions.set_attr("bgcolor", event.color)

        self.grid.ForceRefresh()

        self.grid.update_attribute_toolbar()

        event.Skip()
675607
def toggle_highlighting(self, state):
        """"""
        if self.editor is not None:
            if state:
                self.highlight_matches()
            else:
                self.clear_matches()
113359
def delete(self):
        

        if self.grid.IsSelection():
            # Delete selection
            self.grid.actions.delete_selection()

        else:
            # Delete cell at cursor
            cursor = self.grid.actions.cursor
            self.grid.actions.delete_cell(cursor)

        # Update grid
        self.grid.ForceRefresh()
231675
def reject(self):
        
        self.canvas.unsetMapTool(self.rectangle_map_tool)
        self.rectangle_map_tool.reset()

        super(OsmDownloaderDialog, self).reject()
855249
public final void removeHelperTextColor(@ColorInt final int color) {
        int index = helperTextColors.indexOf(color);

        if (index != -1) {
            helperTextColors.remove(index);
            verifyPasswordStrength();
        }
    }
1365280
function(callback) {
				// tell the user what we’re doing
				grunt.verbose.writeln('Validating options…');

				// make sure alpha is valid
				if (!validateAlpha(options.alpha)) {
					return grunt.fail.fatal('Invalid `alpha` option');
				}
				grunt.verbose.writeln('`alpha` option OK');

				// make sure background is valid
				if (!validateBackground(options.background)) {
					return grunt.fail.fatal('Invalid `background` option');
				}
				grunt.verbose.writeln('`background` option OK');

				// make sure colorspace is valid
				if (!validateColorspace(options.colorspace)) {
					return grunt.fail.fatal('Invalid `colorspace` option');
				}
				grunt.verbose.writeln('`colorspace` option OK');

				// make sure dither is valid
				if (!validateDither(options.dither)) {
					return grunt.fail.fatal('Invalid `dither` option');
				}
				grunt.verbose.writeln('`dither` option OK');

				// make sure filter is valid
				if (!validateFilter(options.filter)) {
					return grunt.fail.fatal('Invalid `filter` option');
				}
				grunt.verbose.writeln('`filter` option OK');

				// make sure filterSupport is valid
				if (!validateFilterSupport(options.filterSupport)) {
					return grunt.fail.fatal('Invalid `filterSupport` option');
				}
				grunt.verbose.writeln('`filterSupport` option OK');

				// make sure interlace is valid
				if (!validateInterlace(options.interlace)) {
					return grunt.fail.fatal('Invalid `interlace` option');
				}
				grunt.verbose.writeln('`interlace` option OK');

				// make sure jpegFancyUpsampling is valid
				if (!validateJpegFancyUpsampling(options.jpegFancyUpsampling)) {
					return grunt.fail.fatal('Invalid `jpegFancyUpsampling` option');
				}
				grunt.verbose.writeln('`jpegFancyUpsampling` option OK');

				// make sure optimize is valid
				var optimize = validateOptimize(options.optimize)
				if (!optimize) {
					return grunt.fail.fatal('Invalid `optimize` option');
				} else {
					options.optimize = optimize;
				}
				grunt.verbose.writeln('`optimize` option OK');

				// make sure image_optim is available
				if ((options.optimize.input.image_optim > 0 || options.optimize.output.image_optim > 0) && !binPath.image_optim) {
					return grunt.fail.fatal('Unable to locate image_optim.');
				} else if (options.optimize.input.image_optim > 0 || options.optimize.output.image_optim > 0) {
					grunt.verbose.writeln('image_optim located');
				} else {
					grunt.verbose.writeln('image_optim not needed');
				}

				// make sure picopt is available
				if ((options.optimize.input.picopt > 0 || options.optimize.output.picopt > 0) && !binPath.picopt) {
					return grunt.fail.fatal('Unable to locate picopt.');
				} else if (options.optimize.input.picopt > 0 || options.optimize.output.picopt > 0) {
					grunt.verbose.writeln('picopt located');
				} else {
					grunt.verbose.writeln('picopt not needed');
				}

				// make sure ImageOptim is available
				if ((options.optimize.input.imageOptim > 0 || options.optimize.output.imageOptim > 0) && !binPath.imageOptim) {
					return grunt.fail.fatal('Unable to locate ImageOptim-CLI.');
				} else if (options.optimize.input.imageOptim > 0 || options.optimize.output.imageOptim > 0) {
					grunt.verbose.writeln('ImageOptim-CLI located');
				} else {
					grunt.verbose.writeln('ImageOptim-CLI not needed');
				}

				// make sure pngCompressionFilter is valid
				if (!validatePngCompressionFilter(options.pngCompressionFilter)) {
					return grunt.fail.fatal('Invalid `pngCompressionFilter` option');
				}
				grunt.verbose.writeln('`pngCompressionFilter` option OK');

				// make sure pngCompressionLevel is valid
				if (!validatePngCompressionLevel(options.pngCompressionLevel)) {
					return grunt.fail.fatal('Invalid `pngCompressionLevel` option');
				}
				grunt.verbose.writeln('`pngCompressionLevel` option OK');

				// make sure pngCompressionStrategy is valid
				if (!validatePngCompressionStrategy(options.pngCompressionStrategy)) {
					return grunt.fail.fatal('Invalid `pngCompressionStrategy` option');
				}
				grunt.verbose.writeln('`pngCompressionStrategy` option OK');

				// make sure pngExcludeChunk is valid
				if (!validatePngExcludeChunk(options.pngExcludeChunk)) {
					return grunt.fail.fatal('Invalid `pngExcludeChunk` option');
				}
				grunt.verbose.writeln('`pngExcludeChunk` option OK');

				// make sure pngPreserveColormap is valid
				if (!validatePngPreserveColormap(options.pngPreserveColormap)) {
					return grunt.fail.fatal('Invalid `pngPreserveColormap` option');
				}
				grunt.verbose.writeln('`pngPreserveColormap` option OK');

				// make sure posterize is valid
				if (!validatePosterize(options.posterize)) {
					return grunt.fail.fatal('Invalid `posterize` option');
				}
				grunt.verbose.writeln('`posterize` option OK');

				// make sure quality is valid
				if (!validateQuality(options.quality)) {
					return grunt.fail.fatal('Invalid `quality` option');
				}
				grunt.verbose.writeln('`quality` option OK');

				// make sure resizeFunction is valid
				if (!validateResizeFunction(options.resizeFunction)) {
					return grunt.fail.fatal('Invalid `resizeFunction` option');
				}
				grunt.verbose.writeln('`resizeFunction` option OK');

				// make sure strip is valid
				if (!validateStrip(options.strip)) {
					return grunt.fail.fatal('Invalid `strip` option');
				}
				grunt.verbose.writeln('`strip` option OK');

				// make sure svgoPlugins is valid
				if (!validateSvgoPlugins(options.svgoPlugins)) {
					return grunt.fail.fatal('Invalid `svgoPlugins` option');
				}
				grunt.verbose.writeln('`svgoPlugins` option OK');

				// make sure unsharp is valid
				if (!validateUnsharp(options.unsharp)) {
					return grunt.fail.fatal('Invalid `unsharp` option');
				}
				grunt.verbose.writeln('`unsharp` option OK');

				// make sure widthAsDir is valid
				if (!validateWidthAsDir(options.widthAsDir)) {
					return grunt.fail.fatal('Invalid `widthAsDir` option');
				}
				grunt.verbose.writeln('`pngPreserveColormap` option OK');

				// make sure the widths are valid
				if (!validateWidths(options.widths)) {
					return grunt.fail.fatal('Invalid `widths` option');
				}
				grunt.verbose.writeln('`widths` option OK');

				// make sure there are images to resize
				if (task.files.length === 0) {
					return grunt.fail.fatal('No valid source files were found.');
				}
				grunt.verbose.writeln('Source files found');

				// loop through each input
				async.each(task.files, function(file, callback2) {
					// make sure we have a valid target and source
					validateTarget(file);
					validateSource(file);
					callback2();
				}, callback);
			}
1026699
def on_unselect(self, item, action):
        """"""
        if not isinstance(item, int):
            item = self.items.index(item)

        self._on_unselect[item] = action
1362510
public function removeColor(ColorSelection $colorSelection)
    {
        if ($this->colorSelections->contains($colorSelection)) {
            $this->colorSelections->removeElement($colorSelection);
        }
    }
713822
function destroyEditOverlay() {
  if (overlay) {
    overlay.parentNode.removeChild(overlay);
    overlay = null;
  }

  document.removeEventListener('click', handleDocumentClick);
  document.removeEventListener('keyup', handleDocumentKeyup);
  document.removeEventListener('mousedown', handleDocumentMousedown);
  document.removeEventListener('mousemove', handleDocumentMousemove);
  document.removeEventListener('mouseup', handleDocumentMouseup);
  enableUserSelect();
}
717383
def validate(self, qstr, editing=True):
        """"""
        valid = self.is_valid(qstr)
        if self.hasFocus() and valid is not None:
            if editing and not valid:
                # Combo box text is being modified: invalidate the entry
                self.show_tip(self.tips[valid])
                self.valid.emit(False, False)
            else:
                # A new item has just been selected
                if valid:
                    self.selected()
                else:
                    self.valid.emit(False, False)
652826
function(e) {
      Event.stopEvent(e);
      this.editorContainer.style.display = 'none';
      this.formattedContainer.style.display = '';
   }
333546
def delete_selection(self):
        """"""
        selection = self.selection
        if selection is None:
            return
        if isinstance(selection, ArrowWidget):
            self.mainscreen.boardview.board.rm_arrow(
                selection.origin.name,
                selection.destination.name
            )
            selection.portal.delete()
        elif isinstance(selection, Spot):
            self.mainscreen.boardview.board.rm_spot(selection.name)
            selection.proxy.delete()
        else:
            assert isinstance(selection, Pawn)
            self.mainscreen.boardview.board.rm_pawn(selection.name)
            selection.proxy.delete()
        self.selection = None
404162
function checkColorMode() {
    if (angular.isUndefined(usesRGBA)) {
      var testerElement = compile('<div md-colors="{background: \'red\'}" >');
      usesRGBA = testerElement[0].style.background.indexOf('rgba') === 0;
    }
  }
839950
function colorBox(selection, label) {
  selection
      .classed('form-row', true)
      .classed('align-items-center', true)
      .on('change', () => {
        // avoid update by mousemove on the colorpicker
        d3.event.stopPropagation();
      });
  selection.append('div')
      .classed('form-group', true)
      .classed('col-form-label', true)
      .classed('col-form-label-sm', true)
      .classed('col-4', true)
      .classed('mb-1', true)
      .text(label);
  selection.append('div')
      .classed('form-group', true)
      .classed('col-form-label', true)
      .classed('col-form-label-sm', true)
      .classed('col-4', true)
      .classed('mb-1', true)
    .append('input')
      .classed('form-control', true)
      .classed('form-control-sm', true)
      .attr('type', 'color');
}
361590
def cancel_button_clicked(self):
        """"""
        # Change mode
        self.mode = CHOOSE_MODE
        # Enable all edit buttons and combo boxes
        for i in range(len(self.exposures)):
            if i == self.special_case_index:
                self.exposure_edit_buttons[i].setEnabled(False)
                self.exposure_combo_boxes[i].setEnabled(False)
                continue
            if self.get_classification(self.exposure_combo_boxes[i]):
                self.exposure_edit_buttons[i].setEnabled(True)
            else:
                self.exposure_edit_buttons[i].setEnabled(False)
            # self.exposure_edit_buttons[i].setText(tr('Edit'))
            self.exposure_combo_boxes[i].setEnabled(True)

        # Clear right panel
        clear_layout(self.right_layout)
        # Show current state
        self.show_current_state()
        # Unset active exposure
        self.active_exposure = None

        self.parent.pbnNext.setEnabled(self.is_ready_to_next_step())