| Index: ui/gfx/color_utils.h
|
| ===================================================================
|
| --- ui/gfx/color_utils.h (revision 91577)
|
| +++ ui/gfx/color_utils.h (working copy)
|
| @@ -7,6 +7,7 @@
|
| #pragma once
|
|
|
| #include "third_party/skia/include/core/SkColor.h"
|
| +#include "ui/ui_api.h"
|
|
|
| class SkBitmap;
|
|
|
| @@ -22,11 +23,11 @@
|
| unsigned char GetLuminanceForColor(SkColor color);
|
|
|
| // Calculated according to http://www.w3.org/TR/WCAG20/#relativeluminancedef
|
| -double RelativeLuminance(SkColor color);
|
| +UI_API 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);
|
| +UI_API void SkColorToHSL(SkColor c, HSL* hsl);
|
| +UI_API 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:
|
| @@ -42,7 +43,7 @@
|
| // 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);
|
| +UI_API SkColor HSLShift(SkColor color, const HSL& shift);
|
|
|
| // Determine if a given alpha value is nearly completely transparent.
|
| bool IsColorCloseToTransparent(SkAlpha alpha);
|
| @@ -57,13 +58,14 @@
|
|
|
| // Builds a histogram based on the Y' of the Y'UV representation of
|
| // this image.
|
| -void BuildLumaHistogram(SkBitmap* bitmap, int histogram[256]);
|
| +UI_API 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);
|
| +UI_API 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
|
| @@ -72,10 +74,10 @@
|
| //
|
| // 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);
|
| +UI_API SkColor GetReadableColor(SkColor foreground, SkColor background);
|
|
|
| // Gets a Windows system color as a SkColor
|
| -SkColor GetSysSkColor(int which);
|
| +UI_API SkColor GetSysSkColor(int which);
|
|
|
| } // namespace color_utils
|
|
|
|
|