Skip to content

ui::ClassicBevelRamp

Header: winui/ui/themes/ClassicPalette.hpp.

The classic 3-D bevel ramp: the four rings draw_bevel_border() draws around a raised or sunken classic control.

Usually derived from a face color with classic_bevel_ramp_from_face(). A scheme that states its own ramp, such as High Contrast Black, sets ClassicPalette::bevel instead.

Example:

// In a custom control's render_override(): a sunken well on Windows 95's gray, whose ramp is
// `#DFDFDF`, white, `#808080` and black.
class WellControl : public ui::Element
{
protected:
    void render_override(ui::Renderer& renderer, const ui::RenderContext&) const override
    {
        const ui::ClassicBevelRamp ramp = ui::classic_bevel_ramp_from_face(ui::Color::from_argb(0xFFC0C0C0));
        ui::draw_bevel_border(renderer, bounds(), ui::BorderStyle::Sunken, ramp.light, ramp.highlight,
                              ramp.shadow, ramp.dark_shadow, 1.0f);
    }
};

Field Type Default
light Color The outer top/left ring, a step lighter than the face.
highlight Color The inner top/left ring, the brightest edge (white on the standard grays).
shadow Color The inner bottom/right ring, a mid gray on the standard grays.
dark_shadow Color The outer bottom/right ring, the darkest edge.