Getting color value in HEX while dumping

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting color value in HEX while dumping

Rajat Gogri
Hello,

I am trying to dump color value for text. Its dumping some wired value like
color="*-7660971*". I am not able to make sense from this. I am
using following code.

*const nsStyleColor* color = GetStyleColor();
fprintf(out, " color=\"%ld\"",(long)color->mColor);*
**
Is there any way to ocnvert this to HEX (RGB) value. Or any other format
which is recognizable.

Thanks and Rgards,
Rajat
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|

Re: Getting color value in HEX while dumping

Jeff Walden-2
Rajat Gogri wrote:
> *const nsStyleColor* color = GetStyleColor();
> fprintf(out, " color=\"%ld\"",(long)color->mColor);*
> **
> Is there any way to ocnvert this to HEX (RGB) value.

Use %lX instead of %ld.  See also the man page for printf using |man 3 printf|, or search Google for a copy.

Jeff
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout