New in version 3.2.
Generate images on the fly.
- class reahl.web.holder.holder.PlaceholderImage(view, x, y, alt=None, text=None, theme=None)¶
PlaceholderImageis an image generated on the client browser using SVG.
view – (See
x – The width of the image (defaults to pixels, can be a string using CSS notation).
y – The height of the image (defaults to pixels, can be a string using CSS notation).
alt – Text to be displayed when the browser cannot handle images.
text – Text to be generated on the image itself.
theme – A
CustomThemeto control what the image should look like.
- class reahl.web.holder.holder.PredefinedTheme(theme_name)¶
There are a few named,
PredefinedThemes you can choose from to control the look of a
theme_name – One of: ‘sky’, ‘vine’, ‘lava’, ‘gray’, ‘industrial’, or ‘social’.
- class reahl.web.holder.holder.CustomTheme(bg=None, fg=None, text_size=None, text_font=None, text_align=None, line_wrap=None, outline=None)¶
CustomThemeallows one to control all the details of what a
PlaceholderImageshould look like.
bg – The background-colour (a string in CSS notation)
fg – The foreground-colour (a string in CSS notation)
text_size – The size of generated text (an int, denoted in pts)
text_font – The name of the font to use for generated text.
text_align – How to align the generated text (one of ‘left’ or ‘right’)
line_wrap – A ratio (line length to image width) at which generated text should wrap.
outline – Draws a border and diagonals in the image.