javax.swing.text.html.StyleSheet.stringToColor()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(199)

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

StyleSheet.stringToColor介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

import javax.swing.text.html.StyleSheet;
StyleSheet s = new StyleSheet();
String rgb="black";
Color c1 = s.stringToColor(rgb);
r1=c1.getRed();
g1=c1.getGreen();
b1=c1.getBlue();
System.out.println(r1+" "+g1+" "+b1);

代码示例来源:origin: elki-project/elki

/**
 * Convert a color name from SVG syntax to an AWT color object.
 *
 * @param str Color name
 * @return Color value
 */
public static Color stringToColor(String str) {
 int icol = SVG_COLOR_NAMES.getInt(str.toLowerCase());
 if(icol != NO_VALUE) {
  return new Color(icol, false);
 }
 return colorLookupStylesheet.stringToColor(str);
}

代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-batik-visualization

/**
 * Convert a color name from SVG syntax to an AWT color object.
 *
 * @param str Color name
 * @return Color value
 */
public static Color stringToColor(String str) {
 int icol = SVG_COLOR_NAMES.get(str.toLowerCase());
 if(icol != NO_VALUE) {
  return new Color(icol, false);
 }
 return colorLookupStylesheet.stringToColor(str);
}

代码示例来源:origin: pentaho/pentaho-reporting

if ( backgroundColor != null ) {
 result.getStyle().setStyleProperty( ElementStyleKeys.BACKGROUND_COLOR,
   sheet.stringToColor( String.valueOf( backgroundColor ) ) );
 final Color color = sheet.stringToColor( String.valueOf( colorText ) );
 result.getStyle().setStyleProperty( ElementStyleKeys.BORDER_BOTTOM_COLOR, color );
 result.getStyle().setStyleProperty( ElementStyleKeys.BORDER_TOP_COLOR, color );
 final Color borderColor = sheet.stringToColor( String.valueOf( borderColorText ) );
 result.getStyle().setStyleProperty( ElementStyleKeys.BORDER_BOTTOM_COLOR, borderColor );
 result.getStyle().setStyleProperty( ElementStyleKeys.BORDER_TOP_COLOR, borderColor );

相关文章