unify semantics of the blend methods

This commit is contained in:
Jinhao
2017-04-15 11:30:16 +08:00
parent f261fa296e
commit 4e9646cf64
24 changed files with 108 additions and 135 deletions

View File

@@ -84,7 +84,7 @@ namespace nana
enum class mouse_action
{
begin, normal = begin, hovered, pressed, end
begin, normal = begin, normal_captured, hovered, pressed, end
};
enum class element_state
@@ -298,8 +298,7 @@ namespace nana
color(color_rgb);
color(color_argb);
color(color_rgba);
color(unsigned red, unsigned green, unsigned blue);
color(unsigned red, unsigned green, unsigned blue, double alpha);
color(unsigned red, unsigned green, unsigned blue, double alpha = 1.0);
/// Initializes the color with a CSS-like rgb string.
explicit color(std::string css_rgb);
@@ -313,10 +312,7 @@ namespace nana
/// @param lightness in range of [0, 1]
color& from_hsl(double hue, double saturation, double lightness); ///< immutable alpha channel
color blend(const color& bgcolor, bool ignore_bgcolor_alpha) const;
/// Blends two colors with the specified alpha, and the alpha values that come with these two colors are both ignored.
color blend(const color& bgcolor, double alpha) const;
color blend(const color& blending_color, double alpha) const;
/// Determines whether the color is completely transparent.
bool invisible() const;

View File

@@ -118,7 +118,7 @@ namespace nana
void bitblt(const ::nana::rectangle& r_dst, const graphics& src, const point& p_src);///< Transfers the color data corresponding to r_dst from the src graphics at point p_src to this graphics.
void blend(const ::nana::rectangle& r, const ::nana::color&, double fade_rate);
void blend(const ::nana::rectangle& s_r, graphics& dst, const point& d_pos, double fade_rate) const;///< blends with the dst object.
void blend(const ::nana::rectangle& blend_r, const graphics& blend_graph, const point& blend_graph_point, double fade_rate);///< blends with the blend_graph.
void blur(const ::nana::rectangle& r, std::size_t radius); ///< Blur process.