okutil_HTML_to_ocolor

 

Description

Convert an HTML hex color string into an Origin OColor

Note: Accepts both normal (#0000FF) and shorthand (#00F) strings with upper or lower case letters.

Syntax

OCOLOR okutil_HTML_to_ocolor(LPCSTR lpcsz)

Parameters

lpcsz
[input] HTML hex color string

Return

Return color value in Origin's OCOLOR format, return 0 if input is not in valid format.

Examples

EX1

void okutil_HTML_to_ocolor_Ex1()
{
        OCOLOR MyColor1 = okutil_HTML_to_ocolor("#00FF00");
        OCOLOR MyColor2 = okutil_HTML_to_ocolor("#0f0");
        if( MyColor2 == MyColor1 )
                printf("Both colors are the same.\n");
}

Remark

See Also

okutil_ocolor_to_HTML

header to Include

origin.h

Reference