aboutsummaryrefslogtreecommitdiffstats
path: root/notes/e-bevel-button-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'notes/e-bevel-button-util.c')
-rw-r--r--notes/e-bevel-button-util.c189
1 files changed, 0 insertions, 189 deletions
diff --git a/notes/e-bevel-button-util.c b/notes/e-bevel-button-util.c
deleted file mode 100644
index cfa01f71a2..0000000000
--- a/notes/e-bevel-button-util.c
+++ /dev/null
@@ -1,189 +0,0 @@
-#include <gtk/gtk.h>
-#include "e-bevel-button-util.h"
-
-static void rgb_to_hls (gdouble *r, gdouble *g, gdouble *b);
-static void hls_to_rgb (gdouble *h, gdouble *l, gdouble *s);
-
-void
-e_bevel_button_util_shade (GdkColor *a,
- GdkColor *b,
- gdouble k)
-{
- gdouble red;
- gdouble green;
- gdouble blue;
-
- red = (gdouble) a->red / 65535.0;
- green = (gdouble) a->green / 65535.0;
- blue = (gdouble) a->blue / 65535.0;
-
- rgb_to_hls (&red, &green, &blue);
-
- green *= k;
- if (green > 1.0)
- green = 1.0;
- else if (green < 0.0)
- green = 0.0;
-
- blue *= k;
- if (blue > 1.0)
- blue = 1.0;
- else if (blue < 0.0)
- blue = 0.0;
-
- hls_to_rgb (&red, &green, &blue);
-
- b->red = red * 65535.0;
- b->green = green * 65535.0;
- b->blue = blue * 65535.0;
-}
-
-static void
-rgb_to_hls (gdouble *r,
- gdouble *g,
- gdouble *b)
-{
- gdouble min;
- gdouble max;
- gdouble red;
- gdouble green;
- gdouble blue;
- gdouble h, l, s;
- gdouble delta;
-
- red = *r;
- green = *g;
- blue = *b;
-
- if (red > green)
- {
- if (red > blue)
- max = red;
- else
- max = blue;
-
- if (green < blue)
- min = green;
- else
- min = blue;
- }
- else
- {
- if (green > blue)
- max = green;
- else
- max = blue;
-
- if (red < blue)
- min = red;
- else
- min = blue;
- }
-
- l = (max + min) / 2;
- s = 0;
- h = 0;
-
- if (max != min)
- {
- if (l <= 0.5)
- s = (max - min) / (max + min);
- else
- s = (max - min) / (2 - max - min);
-
- delta = max -min;
- if (red == max)
- h = (green - blue) / delta;
- else if (green == max)
- h = 2 + (blue - red) / delta;
- else if (blue == max)
- h = 4 + (red - green) / delta;
-
- h *= 60;
- if (h < 0.0)
- h += 360;
- }
-
- *r = h;
- *g = l;
- *b = s;
-}
-
-static void
-hls_to_rgb (gdouble *h,
- gdouble *l,
- gdouble *s)
-{
- gdouble hue;
- gdouble lightness;
- gdouble saturation;
- gdouble m1, m2;
- gdouble r, g, b;
-
- lightness = *l;
- saturation = *s;
-
- if (lightness <= 0.5)
- m2 = lightness * (1 + saturation);
- else
- m2 = lightness + saturation - lightness * saturation;
- m1 = 2 * lightness - m2;
-
- if (saturation == 0)
- {
- *h = lightness;
- *l = lightness;
- *s = lightness;
- }
- else
- {
- hue = *h + 120;
- while (hue > 360)
- hue -= 360;
- while (hue < 0)
- hue += 360;
-
- if (hue < 60)
- r = m1 + (m2 - m1) * hue / 60;
- else if (hue < 180)
- r = m2;
- else if (hue < 240)
- r = m1 + (m2 - m1) * (240 - hue) / 60;
- else
- r = m1;
-
- hue = *h;
- while (hue > 360)
- hue -= 360;
- while (hue < 0)
- hue += 360;
-
- if (hue < 60)
- g = m1 + (m2 - m1) * hue / 60;
- else if (hue < 180)
- g = m2;
- else if (hue < 240)
- g = m1 + (m2 - m1) * (240 - hue) / 60;
- else
- g = m1;
-
- hue = *h - 120;
- while (hue > 360)
- hue -= 360;
- while (hue < 0)
- hue += 360;
-
- if (hue < 60)
- b = m1 + (m2 - m1) * hue / 60;
- else if (hue < 180)
- b = m2;
- else if (hue < 240)
- b = m1 + (m2 - m1) * (240 - hue) / 60;
- else
- b = m1;
-
- *h = r;
- *l = g;
- *s = b;
- }
-}
ns'>+4 * Update to r47846 of the FreeBSD docset.blackend2015-12-182-4/+3 * Update to r47441 of the FreeBSD docset.blackend2015-11-304-3/+11 * Remove duplicate plist entries.blackend2015-10-102-2/+1 * Update to r47441 of the FreeBSD Documentation Set,blackend2015-09-295-93/+93 * Update to r47011 of the FreeBSD docset (a.k.a., definitively, 10.2-R version)blackend2015-07-192-3/+3 * Update to r46935 of the FreeBSD docset (a.k.a. 10.2-R version)blackend2015-07-108-4/+13 * Remove stale plist files and update plist creation scheme.blackend2015-04-291-1/+6 * Update to r46616 of the FreeBSD docset.blackend2015-04-289-122/+29 * Make fonts repecting XDGbapt2015-03-221-4/+4 * Cleanup plistbapt2015-02-051-82/+0 * Update to r46230 of the FreeBSD docset.blackend2015-02-012-3/+3 * Update to r46070 of the FreeBSD docset.blackend2014-12-089-17/+6 * Update to r45683 of the FreeBSD docset (a.k.a. 10.1-R version)blackend2014-09-289-30/+11 * Allow staging as a regular userantoine2014-08-261-1/+1 * Update to r45500 of the FreeBSD docset.blackend2014-08-259-18/+8 * - Fix use of DESTDIRNAME variable [1]blackend2014-07-201-1/+16 * Update to r45106 of the FreeBSD docset (a.k.a. 9.3-R version).blackend2014-06-243-3/+4 * Update to r45038 of the FreeBSD docset.blackend2014-06-159-102/+92 * Remove all space characters from Makefile assignments.olgeni2014-06-091-1/+1 * Update to r44807 of the FreeBSD docset.blackend2014-05-204-21/+23 * Convert all :U to :tu and :L to :tlbapt2014-05-051-2/+2 * Remove the last @comment $FreeBSD$ from plists.mat2014-04-251-1/+0 * Update to r44393 of the FreeBSD docset.blackend2014-04-019-19/+15 * Update to r43641 of the FreeBSD docset.blackend2014-02-273-20/+17 * Update to r43251 of the FreeBSD docset.blackend2014-01-265-11/+20 * Fix properties on pkg-plistbapt2014-01-228-8/+0 * Update to r43251 of the FreeBSD docset (this will be the 10.0-R versionblackend2013-11-303-11/+3 * Update to r43207 of the FreeBSD docset.blackend2013-11-203-56/+37 * - Adjust dependency after textproc/docproj changesgabor2013-11-081-4/+1 * Update to r43088 (official 10.0-R revision) of the FreeBSD docset.blackend2013-11-043-20/+8 * Update to r42697 of the FreeBSD docset.blackend2013-10-013-5/+7 * Add NO_STAGE all over the place in preparation for the staging support (cat: ...bapt2013-09-211-0/+1 * Update to r42489 of the FreeBSD docset (the revision used for 9.2-R)blackend2013-08-033-4/+7 * Update to r42326 of the FreeBSD docset.blackend2013-07-205-20/+10 * Update to r42095 of the FreeBSD docset.blackend2013-07-013-10/+23 * Update to r41954 of the FreeBSD docset.blackend2013-06-2710-43/+40 * Convert to new options frameworkbapt2013-06-051-13/+12 * Update to last revision of doc/release/8.4.0/ i.e. r41380blackend2013-04-092-3/+3 * Update to r41339 of the FreeBSD docset which is the doc/release/8.4.0blackend2013-04-032-3/+3 * Update to r41327 of the FreeBSD docset.blackend2013-04-013-7/+4 * Update to r41075 of the FreeBSD doc set.blackend2013-03-043-9/+3 * Update to r40771 of the FreeBSD docset.blackend2013-02-049-258/+86 * Unbreak INDEXgjb2013-01-051-1/+2 * Update to 40385 rev of the FreeBSD docset.blackend2012-12-162-3/+3 * Update to RELENG_9_1_0 version of the FreeBSD docset.blackend2012-07-3010-25/+7 * Update to r39187 of the FreeBSD docset.blackend2012-07-134-4/+5 * - Bump PORTEPOCH after changing versioning to follow SVN revisions of thegabor2012-06-131-0/+1 * Update to r39016 of the FreeBSD docset.blackend2012-06-123-5/+7 * - update png to 1.5.10dinoex2012-06-011-0/+1 * Update to 20120506 version of the FreeBSD docset.blackend2012-05-084-4/+5 * Update to 20120308 version (last update of the 8.3-R docset) of theblackend2012-03-092-3/+3 * Update to RELEASE_8_3_0 version of the FreeBSD docset.blackend2012-03-063-3/+6 * - Most probably is not MAKE_JOBS_SAFEpav2012-02-151-1/+1 * Update to 20120205 version of the FreeBSD doc set.blackend2012-02-073-4/+5 * Update to 20120114 version of the FreeBSD docset.blackend2012-01-154-4/+11 * Update to 20111014 version of the FreeBSD doc tree (RELEASE_9_0_0blackend2011-10-165-4/+57 * Update to RELEASE_9_0_0 version of the FreeBSD doc/ tree.blackend2011-09-103-3/+9 * Update to 20110828 version of the FreeBSD docset.blackend2011-08-309-5/+11 * Update to 20110710 version of the FreeBSD docset.blackend2011-07-114-4/+10 * Update to 20110611 version of the FreeBSD docset.blackend2011-06-123-4/+4 * Update to 20110521 version of the FreeBSD docset.blackend2011-05-222-3/+3 * Update to 20110416 version of the FreeBSD docset.blackend2011-04-183-4/+5 * Update to 20110313 version of the FreeBSD docset.blackend2011-03-145-4/+12 * Update to 20110215 version of the FreeBSD docset.blackend2011-02-169-4/+20 * Update to RELEASE_8_2_0/RELEASE_7_4_0 version of the FreeBSD doc set.blackend2011-01-123-4/+4 * Update to 20101224 version of the FreeBSD docset.blackend2010-12-263-5/+7 * Update to 20101127 version of the FreeBSD docset.blackend2010-11-293-5/+3 * Fix plist.blackend2010-09-271-2/+0 * Update to 20100926 version of the FreeBSD docset.blackend2010-09-272-4/+4 * Update to 20100828 version of the FreeBSD docset.blackend2010-08-293-4/+5 * Update to 20100811 version of the FreeBSD docset.blackend2010-08-132-4/+4 * Update to RELEASE_8_1_0 version of the FreeBSD doc tree.blackend2010-06-262-4/+4 * Update to 20100605 version of the FreeBSD docset.blackend2010-06-063-5/+5 * Update to 20100519 version of the FreeBSD docset.blackend2010-05-212-4/+4 * Update to version 20100410 of the FreeBSD docset.blackend2010-04-123-5/+5 * - update to 1.4.1dinoex2010-03-281-0/+1 * Update to 20100213 version of the FreeBSD docset.blackend2010-02-142-4/+4 * Update to 20100210 version of the FreeBSD docsetblackend2010-02-122-5/+4 * - update to jpeg-8dinoex2010-02-051-0/+1 * Update to 20100120 version of the FreeBSD docset.blackend2010-01-223-5/+5 * Update to 20091226 version of the FreeBSD docset.blackend2009-12-272-4/+4 * Update to 20091223 version of the FreeBSD docset. This version containsblackend2009-12-232-4/+4 * Update to 20091219 version of the FreeBSD docset.blackend2009-12-204-5/+6 * Update to 20091126 version of the docset.blackend2009-11-293-4/+7 * Update to the RELEASE_8_0_0 tag version of the FreeBSD docset.blackend2009-09-142-4/+4 * Update to 20090903 version of the FreeBSD docset.blackend2009-09-059-4/+15 * Update to 20090820 version of the FreeBSD docset.blackend2009-08-242-4/+4 * Update to 20090801 version of the FreeBSD docset.blackend2009-08-022-4/+4 * Update to version 20090722 of the FreeBSD docset.blackend2009-07-242-4/+4 * Update to version 20090708 of the FreeBSD docset.blackend2009-07-102-4/+4 * Update to 20090628 version of FreeBSD docsetblackend2009-06-292-4/+4 * Fix plists.blackend2009-06-201-0/+1 * Update to the FreeBSD docset version from 20090618.blackend2009-06-193-5/+5 * - Update to doc/ tree version 20090525;blackend2009-05-263-5/+13 * Update freebsd-doc-* ports to RELEASE_7_2_0 revision of doc/.blackend2009-04-18