von HTML zu RGB

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • von HTML zu RGB

    Hi @ all,

    ich habe eine Variable
    PHP Code:
    $farbe "#FEB42D"
    Nun möchte ich dazu eine Funktion, die mir die RGB-Werte ausgibt.

    In diesem Beispiel wäre es: 254, 180, 45

    Weiß jemand wie man das hinbekommt?

    Vielen Dank im Voraus.

    Gruß
    mchashi.

  • #2


    http://www.php.net/manual/de/function.hexdec.php

    Comment


    • #3
      Weiß jemand wie man das hinbekommt?
      so
      PHP Code:
      $farbe "#FEB42D";
      $rot=hexdec(substr($farbe,1,2));
      $gruen=hexdec(substr($farbe,3,2));
      $blau=hexdec(substr($farbe,5,2));
      echo 
      $rot.' '.$gruen.' '.$blau

      Comment


      • #4
        danke schön,

        super!

        Comment

        Working...
        X