当前位置: 首页>>代码示例>>Java>>正文


Java Color.getHue方法代码示例

本文整理汇总了Java中javafx.scene.paint.Color.getHue方法的典型用法代码示例。如果您正苦于以下问题:Java Color.getHue方法的具体用法?Java Color.getHue怎么用?Java Color.getHue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.paint.Color的用法示例。


在下文中一共展示了Color.getHue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createColorVariations

import javafx.scene.paint.Color; //导入方法依赖的package包/类
public static final Color[] createColorVariations(final Color COLOR, final int NO_OF_COLORS) {
    int    noOfColors = clamp(1, 5, NO_OF_COLORS);
    double step       = 0.8 / noOfColors;
    double hue        = COLOR.getHue();
    double brg        = COLOR.getBrightness();
    Color[] colors = new Color[noOfColors];
    for (int i = 0 ; i < noOfColors ; i++) { colors[i] = Color.hsb(hue, 0.2 + i * step, brg); }
    return colors;
}
 
开发者ID:HanSolo,项目名称:horizon,代码行数:10,代码来源:Helper.java

示例2: getColorRangeMinMax

import javafx.scene.paint.Color; //导入方法依赖的package包/类
public static final Color[] getColorRangeMinMax(final Color COLOR, final int STEPS) {
    double hue            = COLOR.getHue();
    double saturation     = COLOR.getSaturation();
    double brightness     = COLOR.getBrightness();
    double saturationStep = saturation / STEPS;
    double brightnessStep = brightness / STEPS;
    double halfSteps      = STEPS / 2;
    Color fromColor       = COLOR.hsb(hue, saturation, clamp(0, 1, brightness + brightnessStep * halfSteps));
    Color toColor         = COLOR.hsb(hue, saturation, clamp(0, 1, brightness - brightnessStep * halfSteps));
    return new Color[] { fromColor, toColor };
}
 
开发者ID:HanSolo,项目名称:horizon,代码行数:12,代码来源:Helper.java

示例3: updateUI

import javafx.scene.paint.Color; //导入方法依赖的package包/类
public void updateUI(final Color color) {
    double hue = color.getHue();
    double saturation = color.getSaturation();
    double brightness = color.getBrightness();
    double alpha = color.getOpacity();
    updateUI(hue, saturation, brightness, alpha);
}
 
开发者ID:EricCanull,项目名称:fxexperience2,代码行数:8,代码来源:ColorPickerControl.java

示例4: updateUI_OnRGBChange

import javafx.scene.paint.Color; //导入方法依赖的package包/类
private Color updateUI_OnRGBChange() {
    // retrieve RGB TextFields values
    int red = Double.valueOf(red_textfield.getText()).intValue();
    int green = Double.valueOf(green_textfield.getText()).intValue();
    int blue = Double.valueOf(blue_textfield.getText()).intValue();
    // retrieve HSB values from RGB values
    final Color color = Color.rgb(red, green, blue);
    double hue = color.getHue();
    double saturation = color.getSaturation();
    double brightness = color.getBrightness();
    double alpha = Double.valueOf(alpha_textfield.getText());
    return updateUI(hue, saturation, brightness, alpha);
}
 
开发者ID:EricCanull,项目名称:fxexperience2,代码行数:14,代码来源:ColorPickerControl.java

示例5: updateUI_OnHexaChange

import javafx.scene.paint.Color; //导入方法依赖的package包/类
private Color updateUI_OnHexaChange() {
    // retrieve Hexa TextField value
    final String hexa = hexa_textfield.getText().trim();
    final Color color = Color.web(hexa);
    double hue = color.getHue();
    double saturation = color.getSaturation();
    double brightness = color.getBrightness();
    double alpha = Double.valueOf(alpha_textfield.getText());
    return updateUI(hue, saturation, brightness, alpha);
}
 
开发者ID:EricCanull,项目名称:fxexperience2,代码行数:11,代码来源:ColorPickerControl.java

示例6: createColorVariations

import javafx.scene.paint.Color; //导入方法依赖的package包/类
public static final List<Color> createColorVariations(final Color COLOR, final int NO_OF_COLORS) {
    int    noOfColors  = clamp(1, 5, NO_OF_COLORS);
    double step        = 0.8 / noOfColors;
    double hue         = COLOR.getHue();
    double brg         = COLOR.getBrightness();
    List<Color> colors = new ArrayList<>(noOfColors);
    for (int i = 0 ; i < noOfColors ; i++) { colors.add(Color.hsb(hue, 0.2 + i * step, brg)); }
    return colors;
}
 
开发者ID:HanSolo,项目名称:charts,代码行数:10,代码来源:Helper.java


注:本文中的javafx.scene.paint.Color.getHue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。