22 lines
1 KiB
Markdown
22 lines
1 KiB
Markdown
# Images
|
|
|
|
Images in grezi can be on your local system, or web URLs. Grezi supports any image format supported by the [image](https://lib.rs/crates/image) crate, including animated images. Images inherit the size of the viewbox they're in, and smoothly transition sizes between viewboxes.
|
|
|
|
Images look like this
|
|
|
|
```
|
|
TitleImage: Image(
|
|
value: "file:recursion.webp",
|
|
tint: "oklab(30% 0.0 0.0)",
|
|
)
|
|
```
|
|
|
|
These are the key-value pairs that are valid for Images
|
|
|
|
- `value`: The image you want the object to load. Can either be
|
|
|
|
- `file:{file path relative to grz file}`
|
|
- `http[s]://{web url}`
|
|
|
|
- `scale`: The logical size to scale the image to. This ignores the size of the viewbox. Can either be a single number which resolves to `{number}x{number}`, or a size in the format of `{width}x{height}`. The image will be resized to fit inside the scale specified, and keep it's aspect ratio.
|
|
- `tint`: [A CSS color 4](https://developer.chrome.com/docs/css-ui/high-definition-css-color-guide) color that will be multiplied by the image.
|