Classes | Defines | Typedefs | Functions

ut_color.h File Reference

#include "ut_types.h"
#include <string>

Go to the source code of this file.


class  UT_ColorPatImpl
class  UT_RGBColor
class  UT_HashColor




typedef void AbiNativeWidget


void UT_setColor (UT_RGBColor &col, unsigned char r, unsigned char g, unsigned char b, bool bTransparent=false)
ABI_EXPORT void UT_parseColor (const char *, UT_RGBColor &)
ABI_EXPORT std::string UT_colorToHex (const char *, bool bPrefix=false)

Define Documentation


Referenced by UT_RGBColor::operator%=().

Typedef Documentation

typedef void AbiNativeWidget

Function Documentation

ABI_EXPORT std::string UT_colorToHex ( const char *  szColor,
bool  bPrefix 

This function takes in a color string of any form (e.g. "red", "CMYK()", "#000000", "000000", etc.) and returns an RGB hexadecimal string.

szColor The incoming string to parse
bPrefix The return string will be prefixed with a '#' if bPrefix is true. Defaults to false.
An RGB hexadecimal string or an empty string if szColor is empty

WARNING: Will return 000000 or #000000 if an invalid color is passed in

References UT_RGBColor::m_blu, UT_RGBColor::m_grn, UT_RGBColor::m_red, UT_HashColor::setColor(), UT_parseColor(), and UT_return_val_if_fail.

Referenced by IE_Exp_HTML_Listener::_makeStylesheet(), IE_Exp_HTML_Listener::_openSpan(), ODe_Style_Style::GraphicProps::fetchAttributesFromAbiProps(), ODe_Style_Style::CellProps::fetchAttributesFromAbiProps(), ODe_Style_Style::TableProps::fetchAttributesFromAbiProps(), ODe_Style_Style::TextProps::fetchAttributesFromAbiProps(), ODe_Style_Style::ParagraphProps::fetchAttributesFromAbiProps(), ODe_Style_PageLayout::fetchAttributesFromAbiSection(), IE_Exp_HTML_StyleTree::IE_Exp_HTML_StyleTree(), IE_Exp_OpenXML::setBackgroundColor(), IE_Exp_OpenXML::setTableBorder(), and IE_Exp_OpenXML::setTextColor().

ABI_EXPORT void UT_parseColor ( const char *  ,
void UT_setColor ( UT_RGBColor col,
unsigned char  r,
unsigned char  g,
unsigned char  b,
bool  bTransparent = false