Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(630)

Unified Diff: gfx/color_utils.h

Issue 6246027: Move src/gfx/ to src/ui/gfx... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gfx/codec/png_codec_unittest.cc ('k') | gfx/color_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gfx/color_utils.h
===================================================================
--- gfx/color_utils.h (revision 73487)
+++ gfx/color_utils.h (working copy)
@@ -6,75 +6,7 @@
#define APP_GFX_COLOR_UTILS_H_
#pragma once
-#include "third_party/skia/include/core/SkColor.h"
+#include "ui/gfx/color_utils.h"
+// TODO(sail): remove this file once all includes have been updated.
-class SkBitmap;
-
-namespace color_utils {
-
-// Represents an HSL color.
-struct HSL {
- double h;
- double s;
- double l;
-};
-
-// Calculated according to http://www.w3.org/TR/WCAG20/#relativeluminancedef
-double RelativeLuminance(SkColor color);
-
-// Note: these transformations assume sRGB as the source color space
-void SkColorToHSL(SkColor c, HSL* hsl);
-SkColor HSLToSkColor(const HSL& hsl, SkAlpha alpha);
-
-// HSL-Shift an SkColor. The shift values are in the range of 0-1, with the
-// option to specify -1 for 'no change'. The shift values are defined as:
-// hsl_shift[0] (hue): The absolute hue value - 0 and 1 map
-// to 0 and 360 on the hue color wheel (red).
-// hsl_shift[1] (saturation): A saturation shift, with the
-// following key values:
-// 0 = remove all color.
-// 0.5 = leave unchanged.
-// 1 = fully saturate the image.
-// hsl_shift[2] (lightness): A lightness shift, with the
-// following key values:
-// 0 = remove all lightness (make all pixels black).
-// 0.5 = leave unchanged.
-// 1 = full lightness (make all pixels white).
-SkColor HSLShift(SkColor color, const HSL& shift);
-
-// Determine if a given alpha value is nearly completely transparent.
-bool IsColorCloseToTransparent(SkAlpha alpha);
-
-// Determine if a color is near grey.
-bool IsColorCloseToGrey(int r, int g, int b);
-
-// Gets a color representing a bitmap. The definition of "representing" is the
-// average color in the bitmap. The color returned is modified to have the
-// specified alpha.
-SkColor GetAverageColorOfFavicon(SkBitmap* bitmap, SkAlpha alpha);
-
-// Builds a histogram based on the Y' of the Y'UV representation of
-// this image.
-void BuildLumaHistogram(SkBitmap* bitmap, int histogram[256]);
-
-// Returns a blend of the supplied colors, ranging from |background| (for
-// |alpha| == 0) to |foreground| (for |alpha| == 255). The alpha channels of
-// the supplied colors are also taken into account, so the returned color may
-// be partially transparent.
-SkColor AlphaBlend(SkColor foreground, SkColor background, SkAlpha alpha);
-
-// Given a foreground and background color, try to return a foreground color
-// that is "readable" over the background color by luma-inverting the foreground
-// color and then picking whichever foreground color has higher contrast against
-// the background color.
-//
-// NOTE: This won't do anything but waste time if the supplied foreground color
-// has a luma value close to the midpoint (0.5 in the HSL representation).
-SkColor GetReadableColor(SkColor foreground, SkColor background);
-
-// Gets a Windows system color as a SkColor
-SkColor GetSysSkColor(int which);
-
-} // namespace color_utils
-
#endif // APP_GFX_COLOR_UTILS_H_
« no previous file with comments | « gfx/codec/png_codec_unittest.cc ('k') | gfx/color_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698