Search in sources :

Example 1 with HSLColor

use of com.biglybt.ui.swt.mainwindow.HSLColor in project BiglyBT by BiglySoftware.

the class TableViewPainted method getColorLine.

private Color getColorLine() {
    if (colorLine == null) {
        colorLine = Colors.getSystemColor(cTable.getDisplay(), SWT.COLOR_LIST_BACKGROUND);
        HSLColor hslColor = new HSLColor();
        hslColor.initHSLbyRGB(colorLine.getRed(), colorLine.getGreen(), colorLine.getBlue());
        int lum = hslColor.getLuminence();
        if (lum > 127)
            lum -= 25;
        else
            lum += 40;
        hslColor.setLuminence(lum);
        colorLine = new Color(cTable.getDisplay(), hslColor.getRed(), hslColor.getGreen(), hslColor.getBlue());
    }
    return colorLine;
}
Also used : HSLColor(com.biglybt.ui.swt.mainwindow.HSLColor) HSLColor(com.biglybt.ui.swt.mainwindow.HSLColor)

Example 2 with HSLColor

use of com.biglybt.ui.swt.mainwindow.HSLColor in project BiglyBT by BiglySoftware.

the class Plot3D method initialize.

@Override
public void initialize(Canvas _canvas) {
    canvas = _canvas;
    Device device = canvas.getDisplay();
    colours = new Color[16];
    HSLColor hsl = new HSLColor();
    hsl.initHSLbyRGB(130, 240, 240);
    int step = 128 / colours.length;
    int hue = colours.length * step;
    for (int i = 0; i < colours.length; i++) {
        hsl.setHue(hue);
        hue -= step;
        colours[i] = new Color(device, hsl.getRed(), hsl.getGreen(), hsl.getBlue());
    }
}
Also used : Device(org.eclipse.swt.graphics.Device) HSLColor(com.biglybt.ui.swt.mainwindow.HSLColor) Color(org.eclipse.swt.graphics.Color) HSLColor(com.biglybt.ui.swt.mainwindow.HSLColor) Point(org.eclipse.swt.graphics.Point)

Aggregations

HSLColor (com.biglybt.ui.swt.mainwindow.HSLColor)2 Color (org.eclipse.swt.graphics.Color)1 Device (org.eclipse.swt.graphics.Device)1 Point (org.eclipse.swt.graphics.Point)1