Skip to content

Instantly share code, notes, and snippets.

View Frolki1-Dev's full-sized avatar
💘
Love to code

Frank Giger Frolki1-Dev

💘
Love to code
View GitHub Profile
@Frolki1-Dev
Frolki1-Dev / get_brightness.php
Created March 25, 2019 21:28
[PHP] Get the brightness of a color
<?php
/**
* Get the brightness of the color.
* The return value is between 0 and 1.
* 0 = light
* 1 = dark
*
* @param string $hex The hex code of the color
* @return float|int
*/
@Frolki1-Dev
Frolki1-Dev / icons.php
Last active February 3, 2019 08:54
Get all icon classes of font awesome
<?php
$json = json_decode(file_get_contents('icons.json'));
$icons = [];
foreach ($json as $class => $icon) {
$name = 'fa-' . $class;
foreach ($icon->styles as $type) {
switch($type) {

Keybase proof

I hereby claim:

  • I am frolki1-dev on github.
  • I am frolki1_dev (https://keybase.io/frolki1_dev) on keybase.
  • I have a public key ASDN2n3tFjvT3LXwgzPgM7baCu7ELf_9nEeXs84EqRMhEgo

To claim this, I am signing this object: