Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
github.com/jacastanon01/color-picker
This is an exploration of how pixels store color. My goal with this project is to learn more about differents way to generate data that can be used for colors. I used raylib to create a simple color spectrum where you can pick a color and see the resulting value of the pixel in RGB format.
Color is a visual perception created by the interaction of light with our eyes. Light consists of electromagnetic waves, and when it strikes an object, certain wavelengths are absorbed while others are reflected. Our eyes perceive these reflected wavelengths as color. In digital systems, color is often represented using the RGB (Red, Green, Blue) model, which combines these three primary colors of light at varying intensities to create a spectrum of colors. Alternatively, the HSL (Hue, Saturation, Lightness) model measures color differently by defining its hue (the type of color), saturation (the intensity of the color), and lightness (the brightness of the color). When creating a color palette with only two pigments, the resulting spectrum is limited, often focusing on gradients between the two, producing a harmonious and visually cohesive range of colors. I generated the HSL values based on pixel position and then converted that data into an RGB format:
func GenerateSpectrum(w, h int32) *rl.Image {
const min, max float32 = 0.5, 1.0
image := rl.GenImageColor(int(w), int(h), rl.Blank)
for y := int32(0); y < h; y++ {
for x := int32(0); x < w; x++ {
var hue float32 = scaleValue((float32(x) / float32(w)), 360, 0)
var saturation float32 = 1 // default to full saturation
var brightness float32 = scaleValue(float32(y)/float32(h), max, min)
imageRGB := rl.ColorFromHSV(hue, saturation, brightness)
rl.ImageDrawPixel(
image, x, y, imageRGB,
)
}
}
return image
}
git clone https://github.com/jacastanon01/color-picker.git
go run cmd/colorpicker/main.go
at the rootFAQs
Unknown package
Did you know?
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.