Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.RGB


            final float green = java.awt.Color.RGBtoHSB(0, 255, 0, null)[0];
            final float deltaSaturation = 0.05f;

            int rgb = java.awt.Color.HSBtoRGB(red, deltaSaturation, hsbvals[2]);
            java.awt.Color cx = new java.awt.Color(rgb);
            bgColor_Err = new Color(Display.getCurrent(), new RGB(cx.getRed(),
                    cx.getGreen(), cx.getBlue()));

            rgb = java.awt.Color.HSBtoRGB(green, 2 * deltaSaturation, hsbvals[2]);
            cx = new java.awt.Color(rgb);
            bgColor_Ok = new Color(Display.getCurrent(), new RGB(cx.getRed(),
                    cx.getGreen(), cx.getBlue()));

            rgb = java.awt.Color.HSBtoRGB(green, deltaSaturation, hsbvals[2]);
            cx = new java.awt.Color(rgb);
            bgColor_AlmostOk = new Color(Display.getCurrent(), new RGB(cx.getRed(),
                    cx.getGreen(), cx.getBlue()));
            disposeColors = true;
        }
    }
View Full Code Here


            @Override
            public void widgetSelected(final SelectionEvent event) {
                final ColorDialog colorDialog = new ColorDialog(fButton.getShell());
                colorDialog.setRGB(fColorValue);
                final RGB newColor = colorDialog.open();
                if (newColor != null) {
                    fColorValue = newColor;
                    updateColorImage();
                }
            }
View Full Code Here

            fPreferenceStore.addPropertyChangeListener(fPreferenceChangeListener);

            fUseSystemColors = fPreferenceStore
                    .getBoolean(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT);
            if (!fUseSystemColors) {
                final RGB bg = createColor(fPreferenceStore,
                        AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND);
                setBackgroundColor(bg);
                final RGB fg = createColor(fPreferenceStore,
                        AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND);
                setForegroundColor(fg);
            }
        }
    }
View Full Code Here

        final String key = event.getProperty();

        if (key.equals(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND)) {

            if (!fUseSystemColors) {
                final RGB bg = createColor(fPreferenceStore,
                        AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND);
                setBackgroundColor(bg);
            }

        } else if (key
                .equals(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT)) {

            fUseSystemColors = fPreferenceStore
                    .getBoolean(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT);
            if (fUseSystemColors) {
                setBackgroundColor(null);
                setForegroundColor(null);
            } else {
                final RGB bg = createColor(fPreferenceStore,
                        AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND);
                setBackgroundColor(bg);
                final RGB fg = createColor(fPreferenceStore,
                        AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND);
                setForegroundColor(fg);
            }
        } else if (key.equals(AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND)) {

            if (!fUseSystemColors) {
                final RGB fg = createColor(fPreferenceStore,
                        AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND);
                setForegroundColor(fg);
            }
        }
View Full Code Here

    private TextAttribute getAttribute(final String string) {
        int style = SWT.NORMAL;
        Color bg = null;
        Color fg = null;
        if (IoRequest.RE_HEADER.matcher(string).lookingAt()) {
            fg = fColorManager.getColor(new RGB(80, 80, 100));
            bg = fColorManager.getColor(new RGB(255, 255, 230));
            style = SWT.BOLD;
        } else if (IoRequest.RE_PROMPT.matcher(string).matches()) {
            fg = fColorManager.getColor(new RGB(80, 80, 80));
            style = SWT.BOLD;
        }
        return new TextAttribute(fg, bg, style);
    }
View Full Code Here

        return event.getProperty().startsWith(ColoringPreferencePage.COLORS_QUALIFIER);
    }

    public void handlePropertyChangeEvent(final PropertyChangeEvent event) {
        String id = null;
        RGB color = null;
        int style = -1;

        final String property = event.getProperty();
        final Object newValue = event.getNewValue();
        if (TokenHighlight.isColorKey(property)) {
View Full Code Here

        if (key == null) {
            return null;
        }

        final RGB rgb = fKeyTable.get(key);
        return getColor(rgb);
    }
View Full Code Here

        final IPreferenceStore store = ErlideUIPlugin.getDefault().getPreferenceStore();

        store.setDefault(PRINT_MARGIN, DEFAULT_PRINT_MARGIN);

        store.setDefault(EDITOR_MATCHING_BRACKETS, true);
        PreferenceConverter.setDefault(store, EDITOR_MATCHING_BRACKETS_COLOR, new RGB(
                190, 140, 190));

        // folding
        store.setDefault(EDITOR_FOLDING_ENABLED, true);
        store.setDefault(EDITOR_FOLDING_PROVIDER,
View Full Code Here

     *            the blue component of the color
     * @return the {@link Color} matching the given red, green and blue
     *         component values
     */
    public static Color getColor(final int r, final int g, final int b) {
        return getColor(new RGB(r, g, b));
    }
View Full Code Here

            foregroundColorInteger = Integer.parseInt(foregroundColorString, 16);
        } catch (final Exception ex) {
            foregroundColorInteger = 0xD2D7FF; // off white
        }

        setForeground(new RGB((foregroundColorInteger & 0xFF0000) >> 16,
                (foregroundColorInteger & 0xFF00) >> 8, foregroundColorInteger & 0xFF));

        final String buildId = ErlangPlugin.getDefault().getCore().getFeatureVersion();
        final Point buildIdPoint;
        // hardcoded to be sensible with our current splash Graphic
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.