<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java_Tutorial%2FSWT%2FSWT_Color</id>
		<title>Java Tutorial/SWT/SWT Color - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java_Tutorial%2FSWT%2FSWT_Color"/>
		<link rel="alternate" type="text/html" href="http://jexp.ru/index.php?title=Java_Tutorial/SWT/SWT_Color&amp;action=history"/>
		<updated>2026-04-10T14:20:45Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://jexp.ru/index.php?title=Java_Tutorial/SWT/SWT_Color&amp;diff=3133&amp;oldid=prev</id>
		<title> в 17:44, 31 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://jexp.ru/index.php?title=Java_Tutorial/SWT/SWT_Color&amp;diff=3133&amp;oldid=prev"/>
				<updated>2010-05-31T17:44:26Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 17:44, 31 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://jexp.ru/index.php?title=Java_Tutorial/SWT/SWT_Color&amp;diff=3134&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://jexp.ru/index.php?title=Java_Tutorial/SWT/SWT_Color&amp;diff=3134&amp;oldid=prev"/>
				<updated>2010-05-31T15:21:13Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==  Change hue, saturation and brightness of a color ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
/*******************************************************************************&lt;br /&gt;
 * Copyright (c) 2000, 2005 IBM Corporation and others.&lt;br /&gt;
 * All rights reserved. This program and the accompanying materials&lt;br /&gt;
 * are made available under the terms of the Eclipse Public License v1.0&lt;br /&gt;
 * which accompanies this distribution, and is available at&lt;br /&gt;
 * http://www.eclipse.org/legal/epl-v10.html&lt;br /&gt;
 *&lt;br /&gt;
 * Contributors:&lt;br /&gt;
 *     IBM Corporation - initial API and implementation&lt;br /&gt;
 *******************************************************************************/&lt;br /&gt;
/*&lt;br /&gt;
 * Change hue, saturation and brightness of a color&lt;br /&gt;
 *&lt;br /&gt;
 * For a list of all SWT example snippets see&lt;br /&gt;
 * http://www.eclipse.org/swt/snippets/&lt;br /&gt;
 * &lt;br /&gt;
 * @since 3.2&lt;br /&gt;
 */&lt;br /&gt;
import org.eclipse.swt.SWT;&lt;br /&gt;
import org.eclipse.swt.graphics.Image;&lt;br /&gt;
import org.eclipse.swt.graphics.ImageData;&lt;br /&gt;
import org.eclipse.swt.graphics.PaletteData;&lt;br /&gt;
import org.eclipse.swt.graphics.RGB;&lt;br /&gt;
import org.eclipse.swt.layout.GridData;&lt;br /&gt;
import org.eclipse.swt.layout.GridLayout;&lt;br /&gt;
import org.eclipse.swt.widgets.Display;&lt;br /&gt;
import org.eclipse.swt.widgets.Label;&lt;br /&gt;
import org.eclipse.swt.widgets.Shell;&lt;br /&gt;
public class ColorChangeHueSaturationBrightness {&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    PaletteData palette = new PaletteData(0xff, 0xff00, 0xff0000);&lt;br /&gt;
    // ImageData showing variations of hue&lt;br /&gt;
    ImageData hueData = new ImageData(360, 100, 24, palette);&lt;br /&gt;
    float hue = 0;&lt;br /&gt;
    for (int x = 0; x &amp;lt; hueData.width; x++) {&lt;br /&gt;
      for (int y = 0; y &amp;lt; hueData.height; y++) {&lt;br /&gt;
        int pixel = palette.getPixel(new RGB(hue, 1f, 1f));&lt;br /&gt;
        hueData.setPixel(x, y, pixel);&lt;br /&gt;
      }&lt;br /&gt;
      hue += 360f / hueData.width;&lt;br /&gt;
    }&lt;br /&gt;
    // ImageData showing saturation on x axis and brightness on y axis&lt;br /&gt;
    ImageData saturationBrightnessData = new ImageData(360, 360, 24, palette);&lt;br /&gt;
    float saturation = 0f;&lt;br /&gt;
    float brightness = 1f;&lt;br /&gt;
    for (int x = 0; x &amp;lt; saturationBrightnessData.width; x++) {&lt;br /&gt;
      brightness = 1f;&lt;br /&gt;
      for (int y = 0; y &amp;lt; saturationBrightnessData.height; y++) {&lt;br /&gt;
        int pixel = palette.getPixel(new RGB(360f, saturation, brightness));&lt;br /&gt;
        saturationBrightnessData.setPixel(x, y, pixel);&lt;br /&gt;
        brightness -= 1f / saturationBrightnessData.height;&lt;br /&gt;
      }&lt;br /&gt;
      saturation += 1f / saturationBrightnessData.width;&lt;br /&gt;
    }&lt;br /&gt;
    Display display = new Display();&lt;br /&gt;
    Image hueImage = new Image(display, hueData);&lt;br /&gt;
    Image saturationImage = new Image(display, saturationBrightnessData);&lt;br /&gt;
    Shell shell = new Shell(display);&lt;br /&gt;
    shell.setText(&amp;quot;Hue, Saturation, Brightness&amp;quot;);&lt;br /&gt;
    GridLayout gridLayout = new GridLayout(2, false);&lt;br /&gt;
    gridLayout.verticalSpacing = 10;&lt;br /&gt;
    gridLayout.marginWidth = gridLayout.marginHeight = 16;&lt;br /&gt;
    shell.setLayout(gridLayout);&lt;br /&gt;
    Label label = new Label(shell, SWT.CENTER);&lt;br /&gt;
    label.setImage(hueImage);&lt;br /&gt;
    GridData data = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 2, 1);&lt;br /&gt;
    label.setLayoutData(data);&lt;br /&gt;
    label = new Label(shell, SWT.CENTER); // spacer&lt;br /&gt;
    label = new Label(shell, SWT.CENTER);&lt;br /&gt;
    label.setText(&amp;quot;Hue&amp;quot;);&lt;br /&gt;
    data = new GridData(SWT.CENTER, SWT.CENTER, false, false);&lt;br /&gt;
    label.setLayoutData(data);&lt;br /&gt;
    label = new Label(shell, SWT.CENTER); // spacer&lt;br /&gt;
    data = new GridData(SWT.CENTER, SWT.CENTER, false, false, 2, 1);&lt;br /&gt;
    label.setLayoutData(data);&lt;br /&gt;
    label = new Label(shell, SWT.LEFT);&lt;br /&gt;
    label.setText(&amp;quot;Brightness&amp;quot;);&lt;br /&gt;
    data = new GridData(SWT.LEFT, SWT.CENTER, false, false);&lt;br /&gt;
    label.setLayoutData(data);&lt;br /&gt;
    label = new Label(shell, SWT.CENTER);&lt;br /&gt;
    label.setImage(saturationImage);&lt;br /&gt;
    data = new GridData(SWT.CENTER, SWT.CENTER, false, false);&lt;br /&gt;
    label.setLayoutData(data);&lt;br /&gt;
    label = new Label(shell, SWT.CENTER); // spacer&lt;br /&gt;
    label = new Label(shell, SWT.CENTER);&lt;br /&gt;
    label.setText(&amp;quot;Saturation&amp;quot;);&lt;br /&gt;
    data = new GridData(SWT.CENTER, SWT.CENTER, false, false);&lt;br /&gt;
    label.setLayoutData(data);&lt;br /&gt;
    shell.pack();&lt;br /&gt;
    shell.open();&lt;br /&gt;
    while (!shell.isDisposed()) {&lt;br /&gt;
      if (!display.readAndDispatch()) {&lt;br /&gt;
        display.sleep();&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    hueImage.dispose();&lt;br /&gt;
    saturationImage.dispose();&lt;br /&gt;
    display.dispose();&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  Create Transparent Color ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
/*******************************************************************************&lt;br /&gt;
 * Copyright (c) 2000, 2006 IBM Corporation and others.&lt;br /&gt;
 * All rights reserved. This program and the accompanying materials&lt;br /&gt;
 * are made available under the terms of the Eclipse Public License v1.0&lt;br /&gt;
 * which accompanies this distribution, and is available at&lt;br /&gt;
 * http://www.eclipse.org/legal/epl-v10.html&lt;br /&gt;
 *&lt;br /&gt;
 * Contributors:&lt;br /&gt;
 *     IBM Corporation - initial API and implementation&lt;br /&gt;
 *******************************************************************************/&lt;br /&gt;
/* &lt;br /&gt;
 *&lt;br /&gt;
 * For a list of all SWT example snippets see&lt;br /&gt;
 * http://www.eclipse.org/swt/snippets/&lt;br /&gt;
 */&lt;br /&gt;
import org.eclipse.swt.SWT;&lt;br /&gt;
import org.eclipse.swt.events.PaintEvent;&lt;br /&gt;
import org.eclipse.swt.events.PaintListener;&lt;br /&gt;
import org.eclipse.swt.graphics.Color;&lt;br /&gt;
import org.eclipse.swt.graphics.Image;&lt;br /&gt;
import org.eclipse.swt.graphics.ImageData;&lt;br /&gt;
import org.eclipse.swt.graphics.PaletteData;&lt;br /&gt;
import org.eclipse.swt.graphics.RGB;&lt;br /&gt;
import org.eclipse.swt.widgets.Canvas;&lt;br /&gt;
import org.eclipse.swt.widgets.Display;&lt;br /&gt;
import org.eclipse.swt.widgets.Shell;&lt;br /&gt;
public class ColorTransparentCreate {&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    final Display display = new Display();&lt;br /&gt;
    Shell shell = new Shell(display);&lt;br /&gt;
    shell.setBounds(10, 10, 200, 200);&lt;br /&gt;
    // create a cursor with a transparent image&lt;br /&gt;
    Color white = display.getSystemColor(SWT.COLOR_WHITE);&lt;br /&gt;
    Color black = display.getSystemColor(SWT.COLOR_BLACK);&lt;br /&gt;
    PaletteData palette = new PaletteData(new RGB[] { white.getRGB(), black.getRGB() });&lt;br /&gt;
    final ImageData sourceData = new ImageData(30, 30, 1, palette);&lt;br /&gt;
    sourceData.transparentPixel = 0;&lt;br /&gt;
    Canvas canvas = new Canvas(shell, SWT.BORDER);&lt;br /&gt;
    canvas.setBounds(10, 50, 150, 100);&lt;br /&gt;
    &lt;br /&gt;
    canvas.addPaintListener(new PaintListener() {&lt;br /&gt;
      public void paintControl(PaintEvent e) {&lt;br /&gt;
        e.gc.drawString(&amp;quot;hide Cursor here&amp;quot;, 10, 10);&lt;br /&gt;
        e.gc.drawImage(new Image(display, sourceData), 0, 0);&lt;br /&gt;
      }&lt;br /&gt;
    });&lt;br /&gt;
    shell.open();&lt;br /&gt;
    while (!shell.isDisposed()) {&lt;br /&gt;
      if (!display.readAndDispatch())&lt;br /&gt;
        display.sleep();&lt;br /&gt;
    }&lt;br /&gt;
    display.dispose();&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>