Okay, here's an SVG code for a stylized castle inspired by the medieval architecture and warm stone tones typical of the Saint-Émilion region in France. It aims for a classic, somewhat rustic look without being overly complex.
You can save this as saint_emilion_castle.svg and open it in any web browser.
<svg width="600" height="500" viewBox="0 0 600 500" xmlns="http://www.w3.org/2000/svg" aria-labelledby="castleTitle" role="img">
<title id="castleTitle">Stylized Castle in Saint-Émilion Style</title>
<defs>
<!-- Define colors as CSS variables for easy customization -->
<style>
:root {
--stone-main: #C2AE8B; /* Warm, light stone */
--stone-dark: #A09070; /* Darker stone for details/shadows */
--roof-tile: #6F302A; /* Terracotta roof */
--window-dark: #333333; /* Dark window/door interior */
--flag-blue: #005A9C;
--flag-white: #FFFFFF;
--flag-red: #EF3340;
}
.castle-fill { fill: var(--stone-main); stroke: var(--stone-dark); stroke-width: 2; }
.castle-roof { fill: var(--roof-tile); stroke: var(--stone-dark); stroke-width: 2; }
.castle-detail { fill: var(--window-dark); }
.flag-pole { stroke: var(--stone-dark); stroke-width: 3; stroke-linecap: round; }
</style>
</defs>
<!-- Background (optional - a hint of sky/ground) -->
<rect x="0" y="0" width="600" height="500" fill="#E0E0E0"/>
<!-- === Main Castle Structure === -->
<g id="castleBody">
<!-- Left Tower -->
<rect x="100" y="150" width="100" height="250" rx="8" class="castle-fill"/>
<!-- Right Tower -->
<rect x="400" y="150" width="100" height="250" rx="8" class="castle-fill"/>
<!-- Central Building -->
<rect x="180" y="200" width="240" height="200" rx="10" class="castle-fill"/>
<!-- Foundation / Base -->
<rect x="80" y="400" width="440" height="50" rx="10" fill="var(--stone-dark)" stroke="var(--stone-main)" stroke-width="2"/>
</g>
<!-- === Roofs === -->
<g id="roofs">
<!-- Left Tower Roof -->
<polygon points="150,80 100,150 200,150" class="castle-roof"/>
<!-- Right Tower Roof -->
<polygon points="450,80 400,150 500,150" class="castle-roof"/>
<!-- Central Building Battlement Wall -->
<path d="M180,200 h240 v-20 h-20 v20 h-20 v-20 h20 v20 h20 v-20 h20 v20 h20 v-20 h20 v20 h20 v-20 h20 v20 h20 v-20 h20 v20 h20 v-20 h20 v20 h20 v-20 h20 V200" class="castle-fill"/>
<!-- For simplicity, using a path that zigzags. More precise crenellations below: -->
<!-- Central Building Crenellations (more detailed version) -->
<g class="castle-fill">
<rect x="195" y="160" width="15" height="20"/>
<rect x="225" y="160" width="15" height="20"/>
<rect x="255" y="160" width="15" height="20"/>
<rect x="285" y="160" width="15" height="20"/>
<rect x="315" y="160" width="15" height="20"/>
<rect x="345" y="160" width="15" height="20"/>
<rect x="375" y="160" width="15" height="20"/>
<rect x="405" y="160" width="15" height="20"/>
</g>
</g>
<!-- === Windows and Doors === -->
<g id="openings" class="castle-detail">
<!-- Main Door (arched) -->
<path d="M280,400 L280,300 A20 20 0 0 1 320,300 L320,400 Z"/>
<!-- Left Tower Windows -->
<rect x="135" y="200" width="30" height="40" rx="3"/>
<rect x="135" y="280" width="30" height="40" rx="3"/>
<!-- Right Tower Windows -->
<rect x="435" y="200" width="30" height="40" rx="3"/>
<rect x="435" y="280" width="30" height="40" rx="3"/>
<!-- Central Building Windows -->
<rect x="230" y="250" width="30" height="40" rx="3"/>
<rect x="340" y="250" width="30" height="40" rx="3"/>
</g>
<!-- === Flag === -->
<g id="flag">
<line x1="150" y1="80" x2="150" y2="40" class="flag-pole"/>
<!-- French Flag -->
<rect x="150" y="40" width="10" height="25" fill="var(--flag-blue)"/>
<rect x="160" y="40" width="10" height="25" fill="var(--flag-white)"/>
<rect x="170" y="40" width="10" height="25" fill="var(--flag-red)"/>
</g>
<!-- === Minor Details (e.g., stone texture lines) === -->
<g id="details" stroke="var(--stone-dark)" stroke-width="1" opacity="0.4">
<!-- Horizontal lines on main building -->
<line x1="180" y1="240" x2="420" y2="240"/>
<line x1="180" y1="290" x2="420" y2="290"/>
<line x1="180" y1="340" x2="420" y2="340"/>
<!-- Horizontal lines on towers -->
<line x1="100" y1="190" x2="200" y2="190"/>
<line x1="100" y1="260" x2="200" y2="260"/>
<line x1="100" y1="330" x2="200" y2="330"/>
<line x1="400" y1="190" x2="500" y2="190"/>
<line x1="400" y1="260" x2="500" y2="260"/>
<line x1="400" y1="330" x2="500" y2="330"/>
</g>
</svg>
Key Design Choices and Features:
- ViewBox for Scalability: The
viewBox attribute (0 0 600 500) ensures the castle scales perfectly to any size without distortion.
- CSS Variables: Colors are defined in a
<style> block using CSS variables (e.g., --stone-main). This makes it incredibly easy to change the entire color scheme by modifying just a few lines.
- Layered Construction: Elements are drawn in a logical order, from background to foreground:
- Background
- Main castle walls and towers
- Roofs and battlements
- Windows and doors
- Flag
- Minor texture details
- Rounded Rectangles:
rx attribute on rectangles gives a slightly softer, more aged look, fitting for old stone buildings.
- Arched Door: A
<path> element is used to create the classic arched doorway.
- Crenellations/Battlements: A series of small rectangles are used on top of the central building to form the distinctive castle battlements.
- Triangular Roofs:
<polygon> elements create the simple, classic pointed roofs on the towers.
- French Flag: Simple rectangles represent the French tricolor.
- Stone Texture (Subtle): Thin, semi-transparent lines are added to give a hint of stone block texture.
- Accessibility: Includes
<title> and aria-labelledby for better accessibility.
This SVG provides a clean, recognizable image of a European-style castle, with colors and elements chosen to evoke the charm of a structure you might find in Saint-Émilion.