Download the PHP package tomloprod/radiance without Composer

On this page you can find all versions of the php package tomloprod/radiance. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package radiance

Beautifully deterministic avatars for PHP

PHP >= 8.2 Version CI Downloads License

✨ About Radiance

Radiance is a modern PHP library designed to generate beautiful, deterministic mesh gradient avatars from any string. Same input always produces the same unique avatar, making it perfect for user profiles, identicons and more.

πŸ‘‰ Try the interactive playground

πŸ“‘ Features

πŸš€ Installation

Requires PHP 8.2+.

Install Radiance via Composer:


✨ Usage

Basic Usage

Generate a simple avatar from a seed:

Advanced Customization

Radiance provides a fluent API to fully customize your avatars:

Pixel Patterns

Add a identicon-like pixelated overlay:

Text Controls

Fine-tune how text is displayed:


🧱 API Reference

Base

Method Description Default
seed(string $seed) Set the deterministic seed. null (random)

Shape & Size

Method Description Default
size(int $size) Set the dimension in pixels (width/height). 512
circle() Set the shape to Circle. -
square() Set the shape to Square. (Square)
squircle() Set the shape to Squircle (rounded). -

Colors

Method Description Default
baseColor(string $color) Influence the generated palette hue. Accepts hex, rgb, or hsl. null
solidColor(string $color) Use a fixed background instead of gradient. null

Gradient Filters

Method Description Default
saturation(float $val) Adjust gradient saturation. 1.0 = original, >1 = vivid, <1 = muted. 1.0
contrast(float $val) Adjust gradient contrast. 1.0 = original, >1 = higher contrast. 1.0
fadeDistance(int $val) Control gradient circle size (40-200). Lower = colors more separated. 50

Text Overlay

Method Description Default
text(string $text) Add a centered text overlay. null
fontFamily(string $font) Set the font-family for the text. monospace
fontSizeRatio(float $ratio) Set font size as ratio of avatar size (0.01-1.0). Disables auto-sizing. 0.5
fontSizeRatioAuto(bool $enabled) Enable/disable automatic font sizing based on text length. true
fontWeight(int $fontWeight) Set the weight of the used font. 600
textShadow(float $val) Set text shadow intensity. 0 = no shadow. 1.0

Pixel Pattern

Method Description Default
enablePixelPattern(bool $enable) Enable/disable the identicon-style overlay. true
pixelGridSize(int $size) Set the pixel grid size (3, 5, 7...). Must be odd for symmetry. 13
pixelOpacity(float $opacity) Set pixel pattern opacity (0.0-1.0). 0.3
pixelDensity(float $density) Control how many pixels are drawn (0.0-1.0). 0.25
pixelColorGradient() Use gradient-derived colors for pixels. (Gradient)
pixelColorMonochrome() Use white color for all pixels. -
pixelColorAccent() Use complementary accent color for pixels. -
pixelShapeSquares() Use square shapes for pixels. (Squares)
pixelShapeCircles() Use circle shapes for pixels. -
pixelShapeMix() Use mixed shapes (deterministic per seed). -

Output

Method Description
toSvg() Get the avatar as an SVG string.
toBase64() Get the avatar as a Base64 encoded data URI.

πŸ§‘β€πŸ€β€πŸ§‘ Contributing

Contributions are welcome! Please review the Contributing Guidelines before submitting a pull request.

  1. Fork the project.
  2. Create a new branch (git checkout -b feature/amazing-feature).
  3. Commit your changes (git commit -m 'Add some feature').
  4. Push to the branch (git push origin feature/amazing-feature).
  5. Open a Pull Request.

πŸ“ License

Radiance is open-sourced software licensed under the MIT license.

Created by TomΓ‘s LΓ³pez β€’ Powered by Colority

All versions of radiance with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2.0
ext-mbstring Version *
tomloprod/colority Version ^1.7.0 || ^2.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tomloprod/radiance contains the following files

Loading the files please wait ...