since: 3.0.0

Declaration [src]

pidgin_color_calculate_for_text (
  const gchar* text,
  GdkRGBA* color

Description [src]

This function is based heavily on the implementation that gajim uses from python-nbxmpp in nbxmpp.util.text_to_color. However, we don’t have an implementation of HSL let alone HSLuv, so we’re using HSV which is why the value is 1.0 instead of a luminance of 0.5.

Currently there is no caching as GCache is deprecated and writing a fast LRU in glib is going to take a bit of finesse. Also we’ll need to figure out how to scale to ginormous Twitch channels which will constantly bust the cache.

Available since: 3.0.0



Type: const gchar*

The text to calculate a color for.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.

Type: GdkRGBA

The return address for a GdkRGBA that will receive the color.

The argument will be set by the function.
The data is owned by the caller of the function.