diff --git a/web/color/color.anubis b/web/color/color.anubis new file mode 100644 index 0000000..f4e5948 --- /dev/null +++ b/web/color/color.anubis @@ -0,0 +1,32 @@ +/* + * Created by PyramIDE. + * User: フランスのトトロ aka (David RENÉ) + * Date: 07/01/2018 + * Time: 11:59 + * © Calexium + */ + +transmit system/string.anubis +transmit system/convert.anubis +transmit tools/maybefloat.anubis + + +public define Int +/** + */ + brightness + ( + String color //color value in hexadecimal form without any prefixed '0x' or '#' + )= + with red = hexa_to_mb_Float(color, 0, 2), + with green = hexa_to_mb_Float(color, 2, 2), + with blue = hexa_to_mb_Float(color, 4, 2), + if sqrt(red * red * success(0.241) + green * green * success(0.691) + blue * blue * success(0.068)) is + { + failure then /*println("brightness failure");*/255, + success(value) then + with result = integral_part(value), + //println("brightness value"+result); + result + } +. -- libgit2 0.21.4