This source file includes following definitions.
- GdkColorToSkColor
- SkColorToGdkColor
#include "ui/gfx/skia_utils_gtk.h"
#include <gdk/gdk.h>
namespace gfx {
const int kSkiaToGDKMultiplier = 257;
SkColor GdkColorToSkColor(GdkColor color) {
return SkColorSetRGB(color.red >> 8, color.green >> 8, color.blue >> 8);
}
GdkColor SkColorToGdkColor(SkColor color) {
GdkColor gdk_color = {
0,
static_cast<guint16>(SkColorGetR(color) * kSkiaToGDKMultiplier),
static_cast<guint16>(SkColorGetG(color) * kSkiaToGDKMultiplier),
static_cast<guint16>(SkColorGetB(color) * kSkiaToGDKMultiplier)
};
return gdk_color;
}
}