Examples of RGB


Examples of org.eclipse.swt.graphics.RGB

      Utils.execSWTThread(new AERunnable() {
        public void runSupport() {
          if (!colorDefault.isDisposed())
            AllocateColor.this.rgbDefault = colorDefault.getRGB();
          else
            AllocateColor.this.rgbDefault = new RGB(0, 0, 0);
        }
      }, false);
    }
View Full Code Here

Examples of org.eclipse.swt.graphics.RGB

        return result;
    }
  
    private Color createColor(int color1, int color2, int ratio, Display display) {
        RGB rgb1= display.getSystemColor(color1).getRGB();
        RGB rgb2= display.getSystemColor(color2).getRGB();

        RGB blend= FormColors.blend(rgb2, rgb1, ratio);

        return new Color(display, blend);
    }
View Full Code Here

Examples of org.eclipse.swt.graphics.RGB

          if (e.button == 1) {
            ColorDialog cd = new ColorDialog(panel.getShell());
            cd.setRGB(blockColors[index].getRGB());
           
            RGB rgb = cd.open();
            if (rgb != null)
              config.setRGBParameter(keys[index], rgb.red, rgb.green, rgb.blue);
          } else {
            config.removeRGBParameter(keys[index]);
          }
        }
      });

      Label lblDesc = new Label(colorSet, SWT.NULL);
      Messages.setLanguageText(lblDesc, keys[i]);

      data = new RowData();
      data.width = 20;
      data.height = lblDesc.computeSize(SWT.DEFAULT, SWT.DEFAULT).y - 3;
      cColor.setLayoutData(data);
     
      // If color changes, update our legend
      config.addParameterListener(keys[i],paramListeners[i] = new ParameterListener() {
        public void parameterChanged(String parameterName) {
          for (int j = 0; j < keys.length; j++) {
            if (keys[j].equals(parameterName)) {
              final int index = j;

              final int r = config.getIntParameter(keys[j] + ".red", -1);
              if (r >= 0) {
                final int g = config.getIntParameter(keys[j] + ".green");
                final int b = config.getIntParameter(keys[j] + ".blue");
               
                final RGB rgb = new RGB(r, g, b);
                if (blockColors[j].isDisposed()
                    || !rgb.equals(blockColors[j].getRGB())) {

                  Utils.execSWTThread(new AERunnable() {
                    public void runSupport() {
                      if (panel == null || panel.isDisposed())
                        return;
View Full Code Here

Examples of org.eclipse.swt.graphics.RGB

    });

    colorChooser.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event e) {
        ColorDialog cd = new ColorDialog(composite.getShell());
        cd.setRGB(new RGB(r,g,b));
        RGB newColor = cd.open();
        if (newColor == null)
          return;
        newColorChosen();
        COConfigurationManager.setRGBParameter(name, newColor.red, newColor.green, newColor.blue);
        newColorSet();
View Full Code Here

Examples of org.eclipse.swt.graphics.RGB

          blue = 0;
        } else if (blue > 255) {
          blue = 255;
        }
       
        RGB rgb = new RGB(red, green, blue);
        float[] hsb = rgb.getHSB();
        hsb[0] += Colors.diffHue;
        if (hsb[0] > 360) {
          hsb[0] -= 360;
        } else if (hsb[0] < 0) {
          hsb[0] += 360;
View Full Code Here

Examples of org.eclipse.swt.graphics.RGB

    if (hsb[2] < 0) {
      hsb[2] = 0;
    } else if (hsb[2] > 1) {
      hsb[2] = 1;
    }
    RGB rgb = new RGB(hsb[0], hsb[1], hsb[2]);
    return getColor(device, rgb.red, rgb.green, rgb.blue);
  }
View Full Code Here

Examples of org.eclipse.swt.graphics.RGB

  private void onAdd() {
    LabelDialog dialog = new LabelDialog(getShell(), DialogMode.ADD, null);
    if (dialog.open() == IDialogConstants.OK_ID) {
      String name = dialog.getName();
      RGB color = dialog.getColor();

      ILabel newLabel = Owl.getModelFactory().createLabel(null, name);
      newLabel.setColor(color.red + "," + color.green + "," + color.blue);
      DynamicDAO.save(newLabel);
View Full Code Here

Examples of org.eclipse.swt.graphics.RGB

      ILabel label = (ILabel) selection.getFirstElement();
      LabelDialog dialog = new LabelDialog(getShell(), DialogMode.EDIT, label);
      if (dialog.open() == IDialogConstants.OK_ID) {
        boolean changed = false;
        String name = dialog.getName();
        RGB color = dialog.getColor();

        if (!label.getName().equals(name)) {
          label.setName(name);
          changed = true;
        }
View Full Code Here

Examples of org.eclipse.swt.graphics.RGB

    /* Font */
    FontData fontData = splash.getDisplay().getSystemFont().getFontData()[0];
    fVersionFont = new Font(splash.getDisplay(), fontData.getName(), 8, SWT.BOLD);

    /* Color */
    fVersionColor = new Color(splash.getDisplay(), new RGB(53, 53, 53));
  }
View Full Code Here

Examples of org.eclipse.swt.graphics.RGB

  }

  void updateResources() {

    /* Sticky Color */
    fStickyBgColor = OwlUI.getThemeColor(OwlUI.STICKY_BG_COLOR_ID, fResources, new RGB(255, 255, 128));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.