org.eclipse.swt.graphics.Color.getBlue()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(155)

本文整理了Java中org.eclipse.swt.graphics.Color.getBlue()方法的一些代码示例,展示了Color.getBlue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Color.getBlue()方法的具体详情如下:
包路径:org.eclipse.swt.graphics.Color
类名称:Color
方法名:getBlue

Color.getBlue介绍

[英]Returns the amount of blue in the color, from 0 to 255.
[中]返回颜色中蓝色的数量,从0到255。

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

private void ok() {
 notePadMeta = new NotePadMeta();
 if ( wDesc.getText() != null ) {
  notePadMeta.setNote( wDesc.getText() );
 }
 if ( wFontName.getText() != null ) {
  notePadMeta.setFontName( wFontName.getText() );
 }
 notePadMeta.setFontSize( wFontSize.getSelection() );
 notePadMeta.setFontBold( wFontBold.getSelection() );
 notePadMeta.setFontItalic( wFontItalic.getSelection() );
 // font color
 notePadMeta.setFontColorRed( wFontColor.getBackground().getRed() );
 notePadMeta.setFontColorGreen( wFontColor.getBackground().getGreen() );
 notePadMeta.setFontColorBlue( wFontColor.getBackground().getBlue() );
 // background color
 notePadMeta.setBackGroundColorRed( wBackGroundColor.getBackground().getRed() );
 notePadMeta.setBackGroundColorGreen( wBackGroundColor.getBackground().getGreen() );
 notePadMeta.setBackGroundColorBlue( wBackGroundColor.getBackground().getBlue() );
 // border color
 notePadMeta.setBorderColorRed( wBorderColor.getBackground().getRed() );
 notePadMeta.setBorderColorGreen( wBorderColor.getBackground().getGreen() );
 notePadMeta.setBorderColorBlue( wBorderColor.getBackground().getBlue() );
 notePadMeta.setDrawShadow( wDrawShadow.getSelection() );
 dispose();
}

代码示例来源:origin: pentaho/pentaho-kettle

String colorName = "bg " + bg.toString();
r[0] = colorName;
r[1] = new Long( ( bg.getRed() << 16 ) + ( bg.getGreen() << 8 ) + ( bg.getBlue() ) );

代码示例来源:origin: pentaho/pentaho-kettle

Color tabColor = new Color( c.getDevice(), c.getRed(), c.getGreen(), c.getBlue() );
tabFolder.setSelectionBackground( tabColor );
break;

代码示例来源:origin: org.piccolo2d/piccolo2d-swt

/** {@inheritDoc} */
public Color getBackground() {
  final org.eclipse.swt.graphics.Color color = gc.getBackground();
  final Color awtColor = new Color(color.getRed(), color.getGreen(), color.getBlue());
  return awtColor;
}

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
public int[] getForeground() {
   Color color = getForegroundSWT();
   if (color == null) {
     return new int[3];
   }
   return new int[] { color.getRed(), color.getGreen(), color.getBlue()
   };
 }

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.forms

/**
 * Tests if the background is white. White background has RGB value
 * 255,255,255.
 *
 * @return <samp>true</samp> if background is white, <samp>false</samp>
 *         otherwise.
 */
public boolean isWhiteBackground() {
  Color bg = getImpliedBackground();
  return bg.getRed() == 255 && bg.getGreen() == 255
      && bg.getBlue() == 255;
}

代码示例来源:origin: org.eclipse.e4.ui.css/swt

public static RGBColor getRGBColor(Color color) {
  int red = color.getRed();
  int green = color.getGreen();
  int blue = color.getBlue();
  return new CSS2RGBColorImpl(red, green, blue);
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

/**
 * Returns a string containing a concise, human-readable
 * description of the receiver.
 *
 * @return a string representation of the receiver
 */
public String toString () {
  if (isDisposed()) return "Color {*DISPOSED*}";
  return "Color {" + getRed() + ", " + getGreen() + ", " + getBlue() + "}";
}

代码示例来源:origin: BiglySoftware/BiglyBT

public static int[] colorToIntArray(Color color) {
  if (color == null || color.isDisposed()) {
    return null;
  }
  return new int[] {
    color.getRed(),
    color.getGreen(),
    color.getBlue()
  };
}

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
public int[] getBackground() {
   Color color = getBackgroundSWT();
   if (color == null) {
     return null;
   }
   return new int[] {
     color.getRed(),
     color.getGreen(),
     color.getBlue()
   };
 }

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.forms

/**
 * Tests if the background is white. White background has RGB value
 * 255,255,255.
 *
 * @return <samp>true</samp> if background is white, <samp>false</samp>
 *         otherwise.
 */
public boolean isWhiteBackground() {
  Color bg = getImpliedBackground();
  return bg.getRed() == 255 && bg.getGreen() == 255
      && bg.getBlue() == 255;
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

private Color computeDashLineColor() {
  Color fg= fTable.getForeground();
  int fGray= (int)(0.3*fg.getRed() + 0.59*fg.getGreen() + 0.11*fg.getBlue());
  Color bg= fTable.getBackground();
  int bGray= (int)(0.3*bg.getRed() + 0.59*bg.getGreen() + 0.11*bg.getBlue());
  int gray= (int)((fGray + bGray) * 0.66);
  return new Color(fDisplay, gray, gray, gray);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private Color computeDashLineColor() {
  Color fg= fTable.getForeground();
  int fGray= (int)(0.3*fg.getRed() + 0.59*fg.getGreen() + 0.11*fg.getBlue());
  Color bg= fTable.getBackground();
  int bGray= (int)(0.3*bg.getRed() + 0.59*bg.getGreen() + 0.11*bg.getBlue());
  int gray= (int)((fGray + bGray) * 0.66);
  return new Color(fDisplay, gray, gray, gray);
}

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

private Color computeDashLineColor() {
  Color fg= fTable.getForeground();
  int fGray= (int)(0.3*fg.getRed() + 0.59*fg.getGreen() + 0.11*fg.getBlue());
  Color bg= fTable.getBackground();
  int bGray= (int)(0.3*bg.getRed() + 0.59*bg.getGreen() + 0.11*bg.getBlue());
  int gray= (int)((fGray + bGray) * 0.66);
  return new Color(fDisplay, gray, gray, gray);
}

代码示例来源:origin: BiglySoftware/BiglyBT

public static String
getWidgetBGColorURLParam()
{
  Color bg = findAnyShell().getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);
  byte[] color = new byte[3];
  color[0] = (byte) bg.getRed();
  color[1] = (byte) bg.getGreen();
  color[2] = (byte) bg.getBlue();
  return( "bg_color=" + ByteFormatter.nicePrint(color));
}

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
public int[] getForeground() {
  if (composite == null || composite.isDisposed()) {
    return null;
  }
  Color fg = composite.getForeground();
  return new int[] {
    fg.getRed(),
    fg.getGreen(),
    fg.getBlue()
  };
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

/**
 * Returns a string containing a concise, human-readable
 * description of the receiver.
 *
 * @return a string representation of the receiver
 */
@Override
public String toString () {
  if (isDisposed()) return "Color {*DISPOSED*}";
  return "Color {" + getRed() + ", " + getGreen() + ", " + getBlue() + ", " + getAlpha() +"}";
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.workbench.renderers.swt

@Override
public void setOuterKeyline(Color color) {
  this.outerKeyline = color;
  // TODO: HACK! Should be set based on pseudo-state.
  if (color != null) {
    setActive(!(color.getRed() == 255 && color.getGreen() == 255 && color.getBlue() == 255));
  }
  parent.redraw();
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

/**
 * Returns a string containing a concise, human-readable
 * description of the receiver.
 *
 * @return a string representation of the receiver
 */
@Override
public String toString () {
  if (isDisposed()) return "Color {*DISPOSED*}";
  return "Color {" + getRed() + ", " + getGreen() + ", " + getBlue() + ", " + getAlpha() +"}";
}

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
  public void runSupport() {
    Color colorTables = Colors.getSystemColor(display, SWT.COLOR_LIST_BACKGROUND);
    HSLColor hslBG = new HSLColor();
    hslBG.initHSLbyRGB(colorTables.getRed(), colorTables.getGreen(),
        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);

相关文章