Giter Club home page Giter Club logo

Comments (1)

hakanson avatar hakanson commented on June 5, 2024

I'm including some short term solutions below and we are designing for better looking images in an upcoming release.

The current release is using the native PlantUML sprite format, which is a grayscale image. These sprites have been generated as [64x64/16z], which is a 64 x 64 resolution at 16 shades of gray. Then, the sprites are re-colored back with the syntax like <color:#D86613><$Lambda></color> which is likely whey they don't look appealing.

Also included in the current distribution alongside the .puml files are 64x64 .png image files which can be referenced using the creole <img> syntax. It is possible to customize the size of the icons using the PlantUML {scale=X} syntax, which works both for the native sprites and png images. Here is an example of that syntax:

participant "<color:#D86613><$Lambda{scale=2}></color>\nLambda"
participant "<img https://raw.githubusercontent.com/awslabs/aws-icons-for-plantuml/v11.1/dist/Compute/Lambda.png{scale=2}>\nLambda"

This image (generated by PlantUML version 2022.5) is each of the Sprite and PNG for Lambda at normal scale, .5 scale, as 2x scale:

Issue 43

Below is the full .puml for the image above. It also defines a custom $AWSPNGImage function to make that <img> generation easier.

@startuml Issue 43
'Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
'SPDX-License-Identifier: MIT (For details, see https://github.com/awslabs/aws-icons-for-plantuml/blob/master/LICENSE)

!define AWSPuml https://raw.githubusercontent.com/awslabs/aws-icons-for-plantuml/v11.1/dist
!include AWSPuml/AWSCommon.puml
!include AWSPuml/Compute/Lambda.puml

!function $AWSPNGImage($img, $scale=1)
!return "<img " + AWSPuml + "/" + $img + "{scale=" + $scale + "}>"
!endfunction

'Hide the bottom boxes
hide footbox

actor User as user
participant "<color:#D86613><$Lambda></color>\nLambda" as lambda1
participant "<color:#D86613><$Lambda{scale=.5}></color>\nLambda" as lambda2
participant "<color:#D86613><$Lambda{scale=2}></color>\nLambda" as lambda3
participant "$AWSPNGImage(Compute/Lambda.png)\nLambda" as lambda4
participant "$AWSPNGImage(Compute/Lambda.png,.5)\nLambda" as lambda5
participant "$AWSPNGImage(Compute/Lambda.png,2)\nLambda" as lambda6

user -> lambda1: colored sprite
user -> lambda2: colored sprite (scale .5)
user -> lambda3: colored sprite (scale 2)
user -> lambda4: png
user -> lambda5: png (scale .5)
user -> lambda6: png (scale 2)
@enduml

from aws-icons-for-plantuml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.