Skip to Content Skip to Menu

generate the Avatar background color starting from the user name in cb

  • saman2
  • saman2
  • ONLINE
  • Posts: 400
  • Thanks: 7
  • Karma: -1
2 years 2 weeks ago - 2 years 2 weeks ago #330573 by saman2
Hi. i want understand how background color generated?look at attached pic:
 

is there any js formula?
i found this:https://codepen.io/sergiopedercini/pen/RLJYLjbut how CB generate? a
nd is it possible get that ?what is your suggest? create color separate according CB formula or get the color from cb?
i use JF_login_pro for user icon in the corner. 
  • Last edit: 2 years 2 weeks ago by saman2.

    Please Log in or Create an account to join the conversation.

    • krileon
    • krileon
    • ONLINE
    • Posts: 48314
    • Thanks: 8253
    • Karma: 1443
    2 years 1 week ago #330599 by krileon
    It's done with PHP. It generates a color based off the text given to it. You can find the code for this below.

    /libraries/CBLib/CBLib/Image/Color.php

    My suggestion is to use CBs login module instead of a 3rd party unsupported login module. You can create a custom layout for CBs using Joomla's built in layout overrides functionality to customize CBs login module to display however you like.


    Kyle (Krileon)
    Community Builder Team Member
    Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
    CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
    --
    If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
    --
    If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
    --
    Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
    --
    My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

    Please Log in or Create an account to join the conversation.

    Moderators: beatnantkrileon
    Powered by Kunena Forum