热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

javafx.scene.paint.Color.getBrightness()方法的使用及代码示例

本文整理了Java中javafx.scene.paint.Color.getBrightness()方法的一些代码示例,展示了Color.getBright

本文整理了Java中javafx.scene.paint.Color.getBrightness()方法的一些代码示例,展示了Color.getBrightness()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Color.getBrightness()方法的具体详情如下:
包路径:javafx.scene.paint.Color
类名称:Color
方法名:getBrightness

Color.getBrightness介绍

暂无

代码示例

代码示例来源:origin: jfoenixadmin/JFoenix

(int) (newColor.getHue()),
(int) (newColor.getSaturation() * 100),
(int) (newColor.getBrightness() * 100));

代码示例来源:origin: us.ihmc/ihmc-javafx-toolkit

@Override
public float[] getTextureLocation(Color color)
{
float x;
if (hueResolution != -1)
x = (float) (color.getHue() / 360.0);
else if (saturationResolution != -1)
x = (float) color.getSaturation();
else
x = (float) color.getBrightness();
float y = 0.5f;
return new float[] {x, y};
}

代码示例来源:origin: us.ihmc/IHMCJavaFXToolkit

@Override
public float[] getTextureLocation(Color color)
{
float x;
if (hueResolution != -1)
x = (float) (color.getHue() / 360.0);
else if (saturationResolution != -1)
x = (float) color.getSaturation();
else
x = (float) color.getBrightness();
float y = 0.5f;
return new float[] {x, y};
}

代码示例来源:origin: us.ihmc/ihmc-javafx-toolkit

@Override
public float[] getTextureLocation(Color color)
{
float x = (float) (hueResolution != -1 ? color.getHue() / 360.0 : color.getSaturation());
float y = (float) (brightnessResolution != -1 ? color.getBrightness() : color.getSaturation());
return new float[] {x, y};
}

代码示例来源:origin: us.ihmc/IHMCJavaFXToolkit

@Override
public float[] getTextureLocation(Color color)
{
float x = (float) (hueResolution != -1 ? color.getHue() / 360.0 : color.getSaturation());
float y = (float) (brightnessResolution != -1 ? color.getBrightness() : color.getSaturation());
return new float[] {x, y};
}

代码示例来源:origin: edu.utah.bmi.nlp/nlp-core

public static int[] getRandomBeautifulColors() {
String colorString=Integer.toHexString((int)Math.floor(Math.random()*16777215));
if(colorString.length()==5) {
colorString = "0" + colorString;
// System.out.println(colorString);
}
Color color = Color.valueOf(colorString);
if(color.getSaturation()>0.78){
color=Color.hsb(color.getHue(),0.78,color.getBrightness());
}
if(color.getBrightness()<0.43){
color=Color.hsb(color.getHue(),color.getSaturation(),0.43);
}
// System.out.println(color.getRed());
// System.out.println(color.getGreen());
// System.out.println(color.getBlue());
int red = (int) (color.getRed() * 255);
int green = (int) (color.getGreen() * 255);
int blue = (int) (color.getBlue() * 255);
return new int[]{red, green, blue};
}

代码示例来源:origin: us.ihmc/robot-environment-awareness-visualizers

private Node createConcaveHullGraphics(PlanarRegion data)
{
int regiOnId= data.getRegionId();
JavaFXMultiColorMeshBuilder meshBuilder = new JavaFXMultiColorMeshBuilder(new TextureColorAdaptivePalette(16));
RigidBodyTransform transform = new RigidBodyTransform();
data.getTransformToWorld(transform);
Point2D[] cOncaveHullVerticesLocal= data.getConcaveHull();
Color regiOnColor= OcTreeMeshBuilder.getRegionColor(regionId);
List cOncaveHullVertices= Arrays.stream(concaveHullVerticesLocal).map(Point3D::new).map(p -> {
transform.transform(p);
return p;
}).collect(Collectors.toList());
for (int vertexIndex = 0; vertexIndex {
Point3D vertex = concaveHullVertices.get(vertexIndex);
Point3D nextVertex = ListWrappingIndexTools.getNext(vertexIndex, concaveHullVertices);
Color lineColor = Color.hsb(regionColor.getHue(), regionColor.getSaturation(), regionColor.getBrightness());
meshBuilder.addLine(vertex, nextVertex, 0.0015, lineColor);
}
MeshView meshView = new MeshView(meshBuilder.generateMesh());
meshView.setMaterial(meshBuilder.generateMaterial());
meshView.setMouseTransparent(true);
return meshView;
}

代码示例来源:origin: us.ihmc/robot-environment-awareness-visualizers

private Node createPriorityQueueGraphics(PlanarRegionSegmentationRawData rawData, ConcaveHullFactoryResult concaveHullFactoryResult)
{
JavaFXMultiColorMeshBuilder meshBuilder = new JavaFXMultiColorMeshBuilder(new TextureColorAdaptivePalette(512));
Point3D planeOrigin = rawData.getOrigin();
Quaternion planeOrientation = rawData.getOrientation();
Color regiOnColor= OcTreeMeshBuilder.getRegionColor(rawData.getRegionId());
for (ConcaveHullVariables intermediateVariables : concaveHullFactoryResult.getIntermediateVariables())
{
PriorityQueue> queue = intermediateVariables.getSortedByLengthQueue();
for (Pair edgeAndTriangle : queue)
{
QuadEdge edge = edgeAndTriangle.getLeft();
Point3D dest = PolygonizerTools.toPointInWorld(edge.dest().getX(), edge.dest().getY(), planeOrigin, planeOrientation);
Point3D orig = PolygonizerTools.toPointInWorld(edge.orig().getX(), edge.orig().getY(), planeOrigin, planeOrientation);
boolean isEdgeTooLOng= dest.distance(orig) > parameters.getEdgeLengthThreshold();
Color lineColor = Color.hsb(regionColor.getHue(), regionColor.getSaturation(), isEdgeTooLong ? 0.25 : regionColor.getBrightness());
meshBuilder.addLine(dest, orig, 0.0015, lineColor);
QuadEdgeTriangle triangle = edgeAndTriangle.getRight();
List triangleVerticesLocal = Arrays.stream(triangle.getVertices()).map(v -> new Point2D(v.getX(), v.getY())).collect(Collectors.toList());
List triangleVerticesWorld = PolygonizerTools.toPointsInWorld(triangleVerticesLocal, planeOrigin, planeOrientation);
double hue = 360.0 * random.nextDouble();
double saturation = 0.8 * random.nextDouble() + 0.1;
double brightness = 0.9;
meshBuilder.addPolyon(triangleVerticesWorld, Color.hsb(hue, saturation, brightness));
}
}
MeshView trianglesMeshView = new MeshView(meshBuilder.generateMesh());
trianglesMeshView.setMaterial(meshBuilder.generateMaterial());
return trianglesMeshView;
}

代码示例来源:origin: us.ihmc/robot-environment-awareness-visualizers

Point3D nextVertex = ListWrappingIndexTools.getNext(vertexIndex, concaveHullVertices);
boolean isEdgeTooLOng= vertex.distance(nextVertex) > parameters.getEdgeLengthThreshold();
Color lineColor = Color.hsb(regionColor.getHue(), regionColor.getSaturation(), isEdgeTooLong ? 0.25 : regionColor.getBrightness());
meshBuilder.addLine(vertex, nextVertex, 0.0015, lineColor);

代码示例来源:origin: us.ihmc/robot-environment-awareness-visualizers

private Node createBorderEdgesGraphics(PlanarRegionSegmentationRawData rawData, ConcaveHullFactoryResult concaveHullFactoryResult)
{
int regiOnId= rawData.getRegionId();
JavaFXMultiColorMeshBuilder meshBuilder = new JavaFXMultiColorMeshBuilder(new TextureColorAdaptivePalette(16));
Point3D planeOrigin = rawData.getOrigin();
Quaternion planeOrientation = rawData.getOrientation();
Color regiOnColor= OcTreeMeshBuilder.getRegionColor(regionId);
for (ConcaveHullVariables intermediateVariables : concaveHullFactoryResult.getIntermediateVariables())
{
Set borderEdges = intermediateVariables.getBorderEdges();
for (QuadEdge edge : borderEdges)
{
Point3D dest = PolygonizerTools.toPointInWorld(edge.dest().getX(), edge.dest().getY(), planeOrigin, planeOrientation);
Point3D orig = PolygonizerTools.toPointInWorld(edge.orig().getX(), edge.orig().getY(), planeOrigin, planeOrientation);
boolean isEdgeTooLOng= dest.distance(orig) > parameters.getEdgeLengthThreshold();
Color lineColor = Color.hsb(regionColor.getHue(), regionColor.getSaturation(), isEdgeTooLong ? 0.25 : regionColor.getBrightness());
meshBuilder.addLine(dest, orig, 0.0015, lineColor);
}
}
MeshView meshView = new MeshView(meshBuilder.generateMesh());
meshView.setMaterial(meshBuilder.generateMaterial());
meshView.setMouseTransparent(true);
return meshView;
}

代码示例来源:origin: com.jfoenix/jfoenix

(int) (newColor.getHue()),
(int) (newColor.getSaturation() * 100),
(int) (newColor.getBrightness() * 100));

推荐阅读
author-avatar
honey爱一个人好难
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有