void initializeColors() { Display display = Display.getDefault(); colors = new Color[] { new Color( display, new RGB( 0, 0, 0 ) ), // black new Color( display, new RGB( 63, 127, 95 ) ), // red new Color( display, new RGB( 0, 0, 192 ) ), // green new Color( display, new RGB( 127, 0, 85 ) ), // blue new Color( display, new RGB( 255, 102, 0 ) ) // Kettle Functions / Orange }; tokenColors = new int[MAXIMUM_TOKEN]; tokenColors[WORD] = 0; tokenColors[WHITE] = 0; tokenColors[KEY] = 3; tokenColors[COMMENT] = 1; tokenColors[STRING] = 2; tokenColors[OTHER] = 0; tokenColors[NUMBER] = 0; tokenColors[FUNCTIONS] = 4; }
void initializeColors() { Display display = Display.getDefault(); colors = new Color[] { new Color( display, new RGB( 0, 0, 0 ) ), // black new Color( display, new RGB( 255, 0, 0 ) ), // red new Color( display, new RGB( 63, 127, 95 ) ), // green new Color( display, new RGB( 0, 0, 255 ) ), // blue new Color( display, new RGB( 255, 0, 255 ) ) // SQL Functions / Rose }; tokenColors = new int[MAXIMUM_TOKEN]; tokenColors[WORD] = 0; tokenColors[WHITE] = 0; tokenColors[KEY] = 3; tokenColors[COMMENT] = 2; tokenColors[STRING] = 1; tokenColors[OTHER] = 0; tokenColors[NUMBER] = 0; tokenColors[VALUESNAME] = 4; }
void initializeColors() { Display display = Display.getDefault(); colors = new Color[] { new Color( display, new RGB( 0, 0, 0 ) ), // black new Color( display, new RGB( 255, 0, 0 ) ), // red new Color( display, new RGB( 63, 127, 95 ) ), // green new Color( display, new RGB( 0, 0, 255 ) ), // blue new Color( display, new RGB( 255, 0, 255 ) ) // SQL Functions / Rose }; tokenColors = new int[MAXIMUM_TOKEN]; tokenColors[WORD] = 0; tokenColors[WHITE] = 0; tokenColors[KEY] = 3; tokenColors[COMMENT] = 2; tokenColors[STRING] = 1; tokenColors[OTHER] = 0; tokenColors[NUMBER] = 0; tokenColors[FUNCTIONS] = 4; }
public Color getColor( int red, int green, int blue ) { RGB rgb = new RGB( red, green, blue ); Color color = colorMap.get( rgb ); if ( color == null ) { color = new Color( display, rgb ); colorMap.put( rgb, color ); } return color; }
private Color getColor( int r, int g, int b ) { Color color = new Color( PropsUI.getDisplay(), new RGB( r, g, b ) ); int index = colors.indexOf( color ); if ( index < 0 ) { colors.add( color ); } else { color.dispose(); color = colors.get( index ); } return color; }
private Color getColor( int r, int g, int b ) { Color color = new Color( PropsUI.getDisplay(), new RGB( r, g, b ) ); int index = colors.indexOf( color ); if ( index < 0 ) { colors.add( color ); } else { color.dispose(); color = colors.get( index ); } return color; }
/** * Returns a {@link Color} given its red, green and blue component values. * * @param r * the red component of the color * @param g * the green component of the color * @param b * the blue component of the color * @return the {@link Color} matching the given red, green and blue component values */ public static Color getColor(int r, int g, int b) { return getColor(new RGB(r, g, b)); } /**
public RGB getBackgroundRGB() { int r = Const.toInt( properties.getProperty( STRING_BACKGROUND_COLOR_R ), ConstUI.COLOR_BACKGROUND_RED ); // Defaut: int g = Const.toInt( properties.getProperty( STRING_BACKGROUND_COLOR_G ), ConstUI.COLOR_BACKGROUND_GREEN ); int b = Const.toInt( properties.getProperty( STRING_BACKGROUND_COLOR_B ), ConstUI.COLOR_BACKGROUND_BLUE ); return new RGB( r, g, b ); }
public RGB getTabColorRGB() { int r = Const.toInt( properties.getProperty( STRING_TAB_COLOR_R ), ConstUI.COLOR_TAB_RED ); // default White int g = Const.toInt( properties.getProperty( STRING_TAB_COLOR_G ), ConstUI.COLOR_TAB_GREEN ); int b = Const.toInt( properties.getProperty( STRING_TAB_COLOR_B ), ConstUI.COLOR_TAB_BLUE ); return new RGB( r, g, b ); }
public RGB getGraphColorRGB() { int r = Const.toInt( properties.getProperty( STRING_GRAPH_COLOR_R ), ConstUI.COLOR_GRAPH_RED ); // default White int g = Const.toInt( properties.getProperty( STRING_GRAPH_COLOR_G ), ConstUI.COLOR_GRAPH_GREEN ); int b = Const.toInt( properties.getProperty( STRING_GRAPH_COLOR_B ), ConstUI.COLOR_GRAPH_BLUE ); return new RGB( r, g, b ); }
/** * Converts BufferedImage to SWT/Image with alpha channel. */ protected Image swing2swt( Device device, BufferedImage img ) { PaletteData palette = new PaletteData( 0xFF0000, 0xFF00, 0xFF ); ImageData data = new ImageData( img.getWidth(), img.getHeight(), 32, palette ); for ( int y = 0; y < data.height; y++ ) { for ( int x = 0; x < data.width; x++ ) { int rgba = img.getRGB( x, y ); int rgb = palette.getPixel( new RGB( ( rgba >> 16 ) & 0xFF, ( rgba >> 8 ) & 0xFF, rgba & 0xFF ) ); int a = ( rgba >> 24 ) & 0xFF; data.setPixel( x, y, rgb ); data.setAlpha( x, y, a ); } } return new Image( device, data ); } }
public void widgetSelected( SelectionEvent arg0 ) { tabColor.dispose(); tabColorRGB = new RGB( ConstUI.COLOR_TAB_RED, ConstUI.COLOR_TAB_GREEN, ConstUI.COLOR_TAB_BLUE ); tabColor = new Color( display, tabColorRGB ); wTabColor.setBackground( tabColor ); wTabColor.redraw(); } } );
public void widgetSelected( SelectionEvent arg0 ) { background.dispose(); backgroundRGB = new RGB( ConstUI.COLOR_BACKGROUND_RED, ConstUI.COLOR_BACKGROUND_GREEN, ConstUI.COLOR_BACKGROUND_BLUE ); background = new Color( display, backgroundRGB ); wBGColor.setBackground( background ); wBGColor.redraw(); } } );
public void widgetSelected( SelectionEvent arg0 ) { graphColor.dispose(); graphColorRGB = new RGB( ConstUI.COLOR_GRAPH_RED, ConstUI.COLOR_GRAPH_GREEN, ConstUI.COLOR_GRAPH_BLUE ); graphColor = new Color( display, graphColorRGB ); wGrColor.setBackground( graphColor ); wGrColor.redraw(); } } );
wFontItalic.setSelection( notePadMeta.isFontItalic() ); fontColor = new Color( shell.getDisplay(), new RGB( notePadMeta.getFontColorRed(), notePadMeta.getFontColorGreen(), notePadMeta.getFontColorBlue() ) ); bgColor = new Color( shell.getDisplay(), new RGB( notePadMeta.getBackGroundColorRed(), notePadMeta .getBackGroundColorGreen(), notePadMeta.getBackGroundColorBlue() ) ); borderColor = new Color( shell.getDisplay(), new RGB( notePadMeta.getBorderColorRed(), notePadMeta .getBorderColorGreen(), notePadMeta.getBorderColorBlue() ) ); wDrawShadow.setSelection( notePadMeta.isDrawShadow() ); fontColor = new Color( shell.getDisplay(), new RGB( NotePadMeta.COLOR_RGB_BLACK_RED, NotePadMeta.COLOR_RGB_BLACK_GREEN, NotePadMeta.COLOR_RGB_BLACK_BLUE ) ); bgColor = new Color( shell.getDisplay(), new RGB( NotePadMeta.COLOR_RGB_DEFAULT_BG_RED, NotePadMeta.COLOR_RGB_DEFAULT_BG_GREEN, NotePadMeta.COLOR_RGB_DEFAULT_BG_BLUE ) ); borderColor = new Color( shell.getDisplay(), new RGB( NotePadMeta.COLOR_RGB_DEFAULT_BORDER_RED, NotePadMeta.COLOR_RGB_DEFAULT_BORDER_GREEN, NotePadMeta.COLOR_RGB_DEFAULT_BORDER_BLUE ) );
for ( int x = 0; x < data.width; x++ ) { raster.getPixel( x, y, pixelArray ); int pixel = palette.getPixel( new RGB( pixelArray[0], pixelArray[1], pixelArray[2] ) ); data.setPixel( x, y, pixel ); data.setAlpha( x, y, pixelArray[3] ); RGB[] rgbs = new RGB[size]; for ( int i = 0; i < rgbs.length; i++ ) { rgbs[i] = new RGB( reds[i] & 0xFF, greens[i] & 0xFF, blues[i] & 0xFF );
ImageUtil.makeImageTransparent( display, loadAsResource( display, BasePropertyHandler .getProperty( "Banner_bg_image" ), 0 ), // , "ui/images/bg_banner.png" new RGB( 255, 255, 255 ) );
@Override public void runSupport() { if (!colorDefault.isDisposed()) AllocateColor.this.rgbDefault = colorDefault.getRGB(); else AllocateColor.this.rgbDefault = new RGB(0, 0, 0); } }, false);