New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

glsl-luma

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

glsl-luma

Get the luma (brightness) of an RGB color in GLSL. Useful for converting images to greyscale

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
45
decreased by-8.16%
Maintainers
1
Weekly downloads
 
Created
Source

glsl-luma stable

Get the luma (brightness) of an RGB color in GLSL. Useful for converting images to greyscale.

glsl-luma

Usage

NPM

float value = luma(vec3 rgb)

float value = luma(vec4 rgba)

Takes a vec3 or vec4 color as input, returning the luma as a float.

precision mediump float;

uniform sampler2D uTexture;
varying vec2 vUv;

#pragma glslify: luma = require(glsl-luma)

void main() {
  vec4 color = texture2D(uTexture, vUv);
  float brightness = luma(color);

  gl_FragColor = vec4(vec3(brightness), 1.0);
}

License

MIT. See LICENSE.md for details.

Keywords

FAQs

Package last updated on 06 Jun 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc