Skip to main content

Colors & Backgrounds

Colors and backgrounds establish the visual foundation of your popup. From simple solid colors to complex gradients and images, XBuilder offers complete control.

Color Formats​

Supported Formats​

FormatExampleUse
Hex#4F46E5Most common
RGBrgb(79, 70, 229)Standard
RGBArgba(79, 70, 229, 0.8)With transparency
NamedindigoSimple colors

Color Picker​

XBuilder includes a visual color picker:

  1. Click color input field
  2. Use color wheel or sliders
  3. Enter values directly
  4. Pick from recent colors

Background Types​

Solid Color​

Single color background:

Background: #ffffff (white)
Background: #1e293b (dark)

Gradient​

Multi-color gradient backgrounds:

Linear Gradient:

Direction: 180deg (top to bottom)
Colors: #667eea → #764ba2

Radial Gradient:

Shape: Circle
Position: Center
Colors: #ffffff → #f1f5f9

Image​

Background image:

SettingOptions
SourceURL or upload
SizeCover, contain, custom
PositionCenter, top, etc.
RepeatNo repeat, repeat
AttachmentScroll, fixed

None/Transparent​

No background (content only).

Setting Backgrounds​

  1. Go to Design tab
  2. Select background type
  3. Configure settings

Element Background​

  1. Select element
  2. Go to Style section
  3. Find Background settings
  4. Configure

Solid Backgrounds​

Common Choices​

PurposeColor
Clean/minimalWhite (#ffffff)
Dark modeDark gray (#1e293b)
SoftLight gray (#f8fafc)
BrandYour brand color
AlertRed (#ef4444)
SuccessGreen (#22c55e)

Transparency​

Use RGBA for transparency:

rgba(255, 255, 255, 0.9) — 90% opaque white
rgba(0, 0, 0, 0.5) — 50% opaque black

Gradient Backgrounds​

Linear Gradients​

Direction options:

  • 0deg — Bottom to top
  • 90deg — Left to right
  • 180deg — Top to bottom
  • 270deg — Right to left
  • 45deg — Diagonal

Sunset:

Direction: 135deg
#ff6b6b → #feca57

Ocean:

Direction: 180deg
#667eea → #764ba2

Nature:

Direction: 120deg
#11998e → #38ef7d

Minimal:

Direction: 180deg
#ffffff → #f1f5f9

Gradient Tips​

  1. Use 2-3 colors maximum
  2. Subtle transitions are elegant
  3. Test on all backgrounds
  4. Consider text readability

Image Backgrounds​

Image Settings​

PropertyOptions
Size
CoverFill entire area
ContainFit within bounds
AutoNatural size
Position
CenterCenter of area
TopAlign to top
BottomAlign to bottom
Repeat
No repeatSingle image
RepeatTile image

Image Overlay​

Add color overlay on images for text readability:

Image: background.jpg
Overlay: rgba(0, 0, 0, 0.5)

Image Optimization​

  1. Compress images
  2. Use WebP format
  3. Appropriate dimensions
  4. Consider lazy loading

Color Schemes​

Creating a Palette​

Start with:

  • Primary — Main brand color
  • Secondary — Accent color
  • Background — Page/popup background
  • Text — Primary text color
  • Muted — Secondary text

Example Palettes​

Professional:

Primary: #4F46E5
Background: #ffffff
Text: #1e293b
Muted: #64748b

Dark Mode:

Primary: #818CF8
Background: #0f172a
Text: #f8fafc
Muted: #94a3b8

Vibrant:

Primary: #f43f5e
Background: #fef2f2
Text: #1e293b
Accent: #fbbf24

Text on Backgrounds​

Contrast Requirements​

BackgroundText Color
WhiteDark (#1e293b or darker)
BlackWhite or light
Light colorsDark text
Dark colorsLight text

On Images​

When using image backgrounds:

  1. Add dark overlay
  2. Use text shadow
  3. Use solid color box behind text
  4. Choose high-contrast text color

Overlay Settings​

The dimmed background behind popup:

Color: #000000
Opacity: 50%
Blur: 0px (or add blur effect)

Content Overlay​

For image backgrounds within popup:

Overlay Color: rgba(0,0,0,0.4)

Responsive Backgrounds​

Device-Specific​

Different backgrounds per device:

Desktop: Large hero image
Tablet: Smaller image
Mobile: Solid color (faster load)

Performance Tips​

Images​

  1. Compress — Use optimized images
  2. Right size — Don't use 4000px for 500px popup
  3. Format — WebP > JPEG > PNG
  4. Lazy load — When possible

Gradients​

  1. Use CSS gradients (not images)
  2. Avoid very complex gradients
  3. Test on older browsers

Best Practices​

  1. Consistent palette — Use 3-5 colors
  2. Contrast — Ensure text is readable
  3. Purpose — Every color should have meaning
  4. Test — Check on different devices
  5. Accessibility — Meet WCAG contrast

Troubleshooting​

Background not showing:

  • Check color value is valid
  • Verify image URL works
  • Look for CSS overrides

Image not covering:

  • Set size to "Cover"
  • Check container dimensions
  • Verify image aspect ratio

Gradient looks wrong:

  • Check color order
  • Verify direction angle
  • Ensure colors are valid