This callback is invoked when the user selects a new color
        hashing algorithm from the preferences pane.
495700
def set_calg_cb(self, w, index):
        """"""
        #index = w.get_index()
        name = self.calg_names[index]
        self.t_.set(color_algorithm=name)
622178
protected void registerColorPickerAttributes() {
        addAttributeProcessor(new CloseAfterPickingLmlAttribute(), "closeAfterPickingFinished", "closeAfter");
        addAttributeProcessor(new ColorPickerListenerLmlAttribute(), "listener");
        addAttributeProcessor(new ColorPickerResponsiveListenerLmlAttribute(), "responsiveListener");
        // BasicColorPicker:
        addAttributeProcessor(new AllowAlphaEditLmlAttribute(), "allowAlphaEdit", "allowAlpha");
        addAttributeProcessor(new BasicColorPickerListenerLmlAttribute(), "listener");
        addAttributeProcessor(new ShowHexFieldLmlAttribute(), "showHex", "showHexField");
    }
1159570
private void colorChooser2ndTextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_colorChooser2ndTextActionPerformed
    if (this.colorChooser2ndText.isLastOkPressed() && changeNotificationAllowed) {
      this.controller.changed();
    }
  }
530970
public void setMajorTickMarkColor(final Color COLOR) {
        if (null == majorTickMarkColor) {
            _majorTickMarkColor = COLOR;
            fireUpdateEvent(REDRAW_EVENT);
        } else {
            majorTickMarkColor.set(COLOR);
        }
    }
510614
function () {
        var i, x, entry

        // Custom selectors
        for (x in this.hashForMethods) {
            if (this.hashForMethods.hasOwnProperty(x)) {
                entry = this.hashForMethods[x]
                this.unscheduleAllSelectorsForTarget(entry.target)
            }
        }
        // Updates selectors
        for (i = 0, len = this.updatesNeg.length; i < len; i++) {
            entry = this.updatesNeg[i]
            if (entry) {
                this.unscheduleUpdateForTarget(entry.target)
            }
        }

        for (i = 0, len = this.updates0.length; i < len; i++) {
            entry = this.updates0[i]
            if (entry) {
                this.unscheduleUpdateForTarget(entry.target)
            }
        }

        for (i = 0, len = this.updatesPos.length; i < len; i++) {
            entry = this.updatesPos[i]
            if (entry) {
                this.unscheduleUpdateForTarget(entry.target)
            }
        }
    }
1164504
def grind_hash_for_colors(hashcode):
    """"""

    # When using smaller hash algorithms like MD5 or SHA1,
    # the number of bits does not provide enough information
    # to generate unique colors. Instead the hash is internally
    # appended by itself to fit the MINIMUM_HASH_LEN.
    # This leads to smaller hashes displaying less color
    # variatons, depicting the insecurity of small hashes.
    while (len(hashcode) < MINIMUM_HASH_LEN):
        chardiff = diff(len(hashcode), MINIMUM_HASH_LEN)
        if DEBUG:
            print ("Hashcode: %r with length: %d is too small. Appending difference." % (hashcode, len(hashcode)))
        hashcode += hashcode[:chardiff]
        if DEBUG:
            print ("Hash is now: %r with length: %d" % (hashcode, len(hashcode)))

    hashparts = split_sequence(hashcode, HEX_COLOR_LEN)

    colors = []

    for i in range(COLOR_QUANTITY):
        colors.append(hex2rgb(hashparts[i]))
    if DEBUG:
        print ("Generated colors: %r" % colors)
    return colors
308502
public static void setSelectionColor(Integer color) {
		final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
		if (prefs != null) {
			if (color == null || color == DEFAULT_SELECTION_COLOR) {
				prefs.remove("SELECTION_COLOR"); //$NON-NLS-1$
			} else {
				prefs.put("SELECTION_COLOR", color.toString()); //$NON-NLS-1$
			}
			try {
				prefs.flush();
			} catch (BackingStoreException exception) {
				//
			}
		}
	}
492733
private void updateRender() {
		if (inherit.isSelected())
		{
			emitter.usePoints = Particle.INHERIT_POINTS;
			oriented.setEnabled( true );
		}
		if (quads.isSelected())
		{
			emitter.usePoints = Particle.USE_QUADS;
			oriented.setEnabled( true );
		}
		if (points.isSelected())
		{
			emitter.usePoints = Particle.USE_POINTS;
			oriented.setEnabled( false );
			oriented.setSelected( false );
		}
		
		// oriented
		if( oriented.isSelected())
			emitter.useOriented= true;
		else
			emitter.useOriented= false;
		
		// additive blending
		if( additive.isSelected())
			emitter.useAdditive= true;
		else
			emitter.useAdditive= false;
	}
1227332
private void startInvertedColors() {
        if (managerFeatures.getInvertedColors().isInverted()) {
            managerFeatures.getInvertedColors().turnOff(mGvrContext.getMainScene());
        } else {
            managerFeatures.getInvertedColors().turnOn(mGvrContext.getMainScene());
        }
    }
1092784
public void setMinorTickMarkColor(final Color COLOR) {
        if (null == minorTickMarkColor) {
            _minorTickMarkColor = COLOR;
            fireUpdateEvent(REDRAW_EVENT);
        } else {
            minorTickMarkColor.set(COLOR);
        }
    }
994117
public void setColor(int color, boolean callback) {

    int alpha = Color.alpha(color);
    int red = Color.red(color);
    int blue = Color.blue(color);
    int green = Color.green(color);

    float[] hsv = new float[3];

    Color.RGBToHSV(red, green, blue, hsv);

    this.alpha = alpha;
    hue = hsv[0];
    sat = hsv[1];
    val = hsv[2];

    if (callback && onColorChangedListener != null) {
      onColorChangedListener.onColorChanged(Color.HSVToColor(this.alpha, new float[] { hue, sat, val }));
    }

    invalidate();
  }
1360375
function(ui)
              {
                switch (settings.color.mode)
                {
                  case 'h':
                    var a = ui.val('a');
                    setAlpha.call($this, colorBarL5, Math.precision(((255 - (a || 0)) * 100) / 255, 4));
                    break;
                  case 's':
                    var hva = ui.val('hva'),
                        saturatedColor = new Color({ h: hva && hva.h || 0, s: 100, v: hva != null ? hva.v : 100 });
                    setBG.call($this, colorBarDiv, saturatedColor.val('hex'));
                    setAlpha.call($this, colorBarL2, 100 - (hva != null ? hva.v : 100));
                    setAlpha.call($this, colorBarL5, Math.precision(((255 - (hva && hva.a || 0)) * 100) / 255, 4));
                    break;
                  case 'v':
                    var hsa = ui.val('hsa'),
                        valueColor = new Color({ h: hsa && hsa.h || 0, s: hsa != null ? hsa.s : 100, v: 100 });
                    setBG.call($this, colorBarDiv, valueColor.val('hex'));
                    setAlpha.call($this, colorBarL5, Math.precision(((255 - (hsa && hsa.a || 0)) * 100) / 255, 4));
                    break;
                  case 'r':
                  case 'g':
                  case 'b':
                    var hValue = 0, vValue = 0, rgba = ui.val('rgba');
                    if (settings.color.mode == 'r')
                    {
                      hValue = rgba && rgba.b || 0;
                      vValue = rgba && rgba.g || 0;
                    }
                    else if (settings.color.mode == 'g')
                    {
                      hValue = rgba && rgba.b || 0;
                      vValue = rgba && rgba.r || 0;
                    }
                    else if (settings.color.mode == 'b')
                    {
                      hValue = rgba && rgba.r || 0;
                      vValue = rgba && rgba.g || 0;
                    }
                    var middle = vValue > hValue ? hValue : vValue;
                    setAlpha.call($this, colorBarL2, hValue > vValue ? Math.precision(((hValue - vValue) / (255 - vValue)) * 100, 4) : 0);
                    setAlpha.call($this, colorBarL3, vValue > hValue ? Math.precision(((vValue - hValue) / (255 - hValue)) * 100, 4) : 0);
                    setAlpha.call($this, colorBarL4, Math.precision((middle / 255) * 100, 4));
                    setAlpha.call($this, colorBarL5, Math.precision(((255 - (rgba && rgba.a || 0)) * 100) / 255, 4));
                    break;
                  case 'a':
                    var a = ui.val('a');
                    setBG.call($this, colorBarDiv, ui.val('hex') || '000000');
                    setAlpha.call($this, colorBarL5, a != null ? 0 : 100);
                    setAlpha.call($this, colorBarL6, a != null ? 100 : 0);
                    break;
                }
              }
1121244
function () {
            if (!this.options.colorByPoint) {
                this.getCyclic('color', this.options.color || defaultPlotOptions[this.type].color, this.chart.options.colors);
            }
        }
1108326
private void colorChooserCollapsatorBackgroundActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_colorChooserCollapsatorBackgroundActionPerformed
    if (changeNotificationAllowed && this.colorChooserCollapsatorBackground.isLastOkPressed()) {
      this.controller.changed();
    }
  }
373339
public void setChromeShadowColor(int color) {
    if (chromeShadowColor != color) {
      viewBorderPaint.setShadowLayer(1, -1, 1, color);
      chromeShadowColor = color;
      invalidate();
    }
  }
1325700
def set_color(opts = {})
      color = Color.new(opts)
      response = put('state', color.to_h)

      response_successful?(response)
    end
1241867
function colorChanged(elem) {
		var color = elem.getAttribute('stroke');

		$.each(mtypes, function(i, pos) {
			var marker = getLinked(elem, 'marker-'+pos);
			if (!marker) {return;}
			if (!marker.attributes.se_type) {return;} // not created by this extension
			var ch = marker.lastElementChild;
			if (!ch) {return;}
			var curfill = ch.getAttribute('fill');
			var curstroke = ch.getAttribute('stroke');
			if (curfill && curfill != 'none') {ch.setAttribute('fill', color);}
			if (curstroke && curstroke != 'none') {ch.setAttribute('stroke', color);}
		});
	}