/** * Set text color. * @param rgbStr - the desired color, in the hex form "RRGGBB". */ public void SetColor(String rgbStr) { CT_RPr pr = run.IsSetRPr() ? run.rPr : run.AddNewRPr(); NPOI.OpenXmlFormats.Wordprocessing.CT_Color color = pr.IsSetColor() ? pr.color : pr.AddNewColor(); color.val = (rgbStr); }
/** * Set text color. * @param rgbStr - the desired color, in the hex form "RRGGBB". */ public void SetColor(String rgbStr) { CT_RPr pr = GetRunProperties(true); NPOI.OpenXmlFormats.Wordprocessing.CT_Color color = pr.IsSetColor() ? pr.color : pr.AddNewColor(); color.val = (rgbStr); }
/** * Get text color. The returned value is a string in the hex form "RRGGBB". */ public String GetColor() { String color = null; if (run.IsSetRPr()) { CT_RPr pr = run.rPr; if (pr.IsSetColor()) { NPOI.OpenXmlFormats.Wordprocessing.CT_Color clr = pr.color; color = clr.val; //clr.xgetVal().getStringValue(); } } return(color); }
public static CT_Color Parse(XmlNode node, XmlNamespaceManager namespaceManager) { if (node == null) return null; CT_Color ctObj = new CT_Color(); ctObj.val = XmlHelper.ReadString(node.Attributes["val"]); if (node.Attributes["themeColor"] != null) ctObj.themeColor = (ST_ThemeColor)Enum.Parse(typeof(ST_ThemeColor), node.Attributes["themeColor"].Value); ctObj.themeTint = XmlHelper.ReadBytes(node.Attributes["themeTint"]); ctObj.themeShade = XmlHelper.ReadBytes(node.Attributes["themeShade"]); return ctObj; }
public CT_FramesetSplitbar() { this.flatBordersField = new CT_OnOff(); this.noBorderField = new CT_OnOff(); this.colorField = new CT_Color(); this.wField = new CT_TwipsMeasure(); }