Convertir un color de Hexadecimal a RGB con PHP

Casi todos los que nos dedicamos a la informática, y especialmente aquellos que nos toca ver de cerca temas de diseño, nos terminamos acostumbrando a utilizar el hexadecimal como anotación para definir los colores.

No obstante hoy os dejamos una pequeña función que sirve para convertir un color de Hexadecimal a RGB con PHP.

 

function Hex2RGB($color){
    $color = str_replace('#', '', $color);
    if (strlen($color) != 6){ return array(0,0,0); }
    $rgb = array();
    for ($x=0;$x<3;$x++){
        $rgb[$x] = hexdec(substr($color,(2*$x),2));
    }
    return $rgb;
}

 

116 responses to “Convertir un color de Hexadecimal a RGB con PHP

  1. akvafort

    I will right away clutch your rss feed as I can not in finding your e-mail subscription hyperlink or newsletter service. Do you have any? Kindly let me understand so that I may just subscribe. Thanks.

  2. visit

    I love what you guys are usually up too. This type of clever work and exposure! Keep up the terrific works guys I’ve included you guys to my own blogroll.

  3. CCNP Collaboration 300-835

    When I initially commented I clicked the -Notify me when new feedback are added- checkbox and now every time a comment is added I get 4 emails with the identical comment. Is there any approach you can take away me from that service? Thanks!

  4. https://www.fapshows.com/

    Hello my loved one! I wish to say that this post is amazing, great written and come with almost all significant infos.I would like to peer extra posts like this.Here is my blog cna certification course (Zelma)

  5. view

    Very nice post and right to the point. I am not sure if this is truly the best place to ask but do you guys have any thoughts on where to hire some professional writers? Thx 🙂

  6. onlinecasino

    I like the helpful information you provide in your articles.I’ll bookmark your blog and check again here regularly.I am quite certain I will learn many new stuff right here!Best of luck for the next!

  7. water slide rentals McAllen

    I’m really impressed with your writing skills as well as with the layout on your blog. Is this a paid theme or did you modify it yourself? Anyway keep up the nice quality writing, it is rare to see a nice blog like this one today..

  8. look

    Hello! This is my first visit to your blog! We are a group of volunteers and starting a new initiative in a community in the same niche. Your blog provided us useful information to work on. You have done a outstanding job!

  9. MRI of the spine

    I blog quite often and I really appreciate your information. This great article has truly peaked my interest. I’m going to book mark your blog and keep checking for new details about once per week. I subscribed to your Feed as well.

  10. Web site

    This article provides clear idea designed for the newpeople of blogging, that in fact how to do running a blog.My blog post – ps4 games my

  11. Susanne

    I will right away grab your rss feed as I can not find your email subscription link or e-newsletter service. Do you have any? Please let me realize so that I may subscribe. Thanks.

  12. visit

    Amazing! This blog looks exactly like my old one!It’s on a totally different subject but it has pretty much the same layout and design. Excellent choice of colors!

  13. Read Here

    ให้สมาชิกทุกท่านได้ร่วมเดิมพันมากเป็นอันดับ 1 โดยที่เว็บของเรานั้นมีการเปิดบอลให้สมาชิกได้เลือกเล่นมากที่สุดในประเทศ โดยผู้เล่นทุกท่านสามารถสมัครเป็นสมาชิกบนเว็บไซต์ของเราได้เสมอ

  14. Wayne Steele

    It’s truly a great and helpful piece of information. I am glad that you simply shared this useful info with us. Please stay us informed like this. Thank you for sharing.

  15. Professional UK watch repairs

    Aw, this was a really nice post. In idea I want to put in writing like this additionally – taking time and actual effort to make a very good article… however what can I say… I procrastinate alot and certainly not appear to get something done.

  16. Internal linking to the site

    Hello there! This is my first visit to your blog! We are a collection of volunteers and starting a new initiative in a community in the same niche. Your blog provided us useful information to work on. You have done a wonderful job!

  17. www.confettieventrental.com

    Hello there, just became alert to your blog through Google, and found that it’s really informative.I’m gonna watch out for brussels. I will be grateful if you continue this in future.Numerous people will be benefited from your writing.Cheers!

Deja una respuesta

Tu dirección de correo electrónico no será publicada.

Rúa Pilar Miró n 6 Santiago de Compostela

Jersey St , Manchester, Greater Manchester M4 6JG, GB

T. 609 538 171 - 634 59 34 43

info@teslatechnologies.com