Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.RGB


          sat = 80;
        }
       
        hslColor.initRGBbyHSL(0, sat, lum);
       
        colorErrorBG = new AllocateColor("errorBG", new RGB(hslColor.getRed(),
            hslColor.getGreen(), hslColor.getBlue()), colorErrorBG).getColor();
      }
    }, false);
  }
View Full Code Here


  private void allocateColorError() {
    if (display == null || display.isDisposed())
      return;

    colorError = new AllocateColor("error", new RGB(255, 68, 68), colorError)
        .getColor();
  }
View Full Code Here

            colorTables.getBlue());
        int lum = hslBG.getLuminence();

        HSLColor hslColor = new HSLColor();
        hslColor.initRGBbyHSL(25, 200, 128 + (lum < 160 ? 10 : -10));
        colorWarning = new AllocateColor("warning", new RGB(hslColor.getRed(),
            hslColor.getGreen(), hslColor.getBlue()), colorWarning).getColor();
      }
    }, false);
  }
View Full Code Here

        //  altHue += 11;
        //} else {
        //  altHue -= 11;
        //}
        //hslColor.setHue(blueHue);
        colorAltRow = new AllocateColor("altRow", new RGB(hslColor.getRed(),
            hslColor.getGreen(), hslColor.getBlue()), colorAltRow).getColor();
      }
    }, false);
  }
View Full Code Here

      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

        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

          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

    });

    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

          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

    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

TOP

Related Classes of org.eclipse.swt.graphics.RGB

Copyright © 2018 www.massapicom. 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.