void eel_make_color_inactive (GdkRGBA *color) { double intensity, saturation; gdouble t; saturation = 0.7; intensity = color->red * 0.30 + color->green * 0.59 + color->blue * 0.11; color->red = SATURATE (color->red); color->green = SATURATE (color->green); color->blue = SATURATE (color->blue); if (intensity > 0.5) { color->red *= 0.9; color->green *= 0.9; color->blue *= 0.9; } else { color->red *= 1.25; color->green *= 1.25; color->blue *= 1.25; } color->red = CLAMP_COLOR (color->red); color->green = CLAMP_COLOR (color->green); color->blue = CLAMP_COLOR (color->blue); }
static void make_color_inactive (EelBackground *self, GdkColor *color) { double intensity, saturation; gushort t; if (!self->details->is_active) { saturation = 0.7; intensity = color->red * 0.30 + color->green * 0.59 + color->blue * 0.11; color->red = SATURATE (color->red); color->green = SATURATE (color->green); color->blue = SATURATE (color->blue); if (intensity > G_MAXUSHORT / 2) { color->red *= 0.9; color->green *= 0.9; color->blue *= 0.9; } else { color->red *= 1.25; color->green *= 1.25; color->blue *= 1.25; } color->red = CLAMP_COLOR (color->red); color->green = CLAMP_COLOR (color->green); color->blue = CLAMP_COLOR (color->blue); } }
Color & Color::operator*=(const Color & c) { r = CLAMP_COLOR(r * c.r); g = CLAMP_COLOR(g * c.g); b = CLAMP_COLOR(b * c.b); return *this; }
Color& Color::operator+=(const Color & c) { r = CLAMP_COLOR(r + c.r); g = CLAMP_COLOR(g + c.g); b = CLAMP_COLOR(b + c.b); return *this; }
Color::Color(double intensity) { b = g = r = CLAMP_COLOR(intensity); }
Color::Color(double rr, double gg, double bb):r(CLAMP_COLOR(rr)),g(CLAMP_COLOR(gg)),b(CLAMP_COLOR(bb)) { }