From 92e7291f60622a0dc36591d38b8eaa55a4b99c56 Mon Sep 17 00:00:00 2001 From: Jon Pretty Date: Fri, 24 Jan 2025 21:38:45 +0100 Subject: [PATCH] Removed most long lines --- src/core/iridescence.Rgb12Opaque.scala | 3 ++- src/core/iridescence.Rgb24Opaque.scala | 4 +++- src/core/iridescence.Rgb32Opaque.scala | 3 ++- src/core/iridescence.RgbHex.scala | 3 ++- src/core/iridescence.colorProfiles.scala | 15 ++++++++++++--- 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/core/iridescence.Rgb12Opaque.scala b/src/core/iridescence.Rgb12Opaque.scala index 5da6a30..08ac6b6 100644 --- a/src/core/iridescence.Rgb12Opaque.scala +++ b/src/core/iridescence.Rgb12Opaque.scala @@ -28,7 +28,8 @@ object Rgb12Opaque: given underlying: Underlying[Rgb12, Int] = ### given Rgb12 is Chromatic = _.srgb.rgb24.asInt - def apply(red: Int, green: Int, blue: Int): Rgb12 = ((red&15) << 8) + ((green&15) << 4) + (blue&15) + def apply(red: Int, green: Int, blue: Int): Rgb12 = + ((red&15) << 8) + ((green&15) << 4) + (blue&15) extension (color: Rgb12) def red: Int = (color >> 8)&15 diff --git a/src/core/iridescence.Rgb24Opaque.scala b/src/core/iridescence.Rgb24Opaque.scala index 68b1aa3..ed240f4 100644 --- a/src/core/iridescence.Rgb24Opaque.scala +++ b/src/core/iridescence.Rgb24Opaque.scala @@ -28,7 +28,9 @@ object Rgb24Opaque: given underlying: Underlying[Rgb24, Int] = ### given Rgb24 is Chromatic = _.asInt - def apply(red: Int, green: Int, blue: Int): Rgb24 = ((red&255) << 16) + ((green&255) << 8) + (blue&255) + def apply(red: Int, green: Int, blue: Int): Rgb24 = + ((red&255) << 16) + ((green&255) << 8) + (blue&255) + def apply(packedInt: Int): Rgb24 = packedInt & 0x00ffffff extension (color: Rgb24) diff --git a/src/core/iridescence.Rgb32Opaque.scala b/src/core/iridescence.Rgb32Opaque.scala index 998fc9b..68f26a9 100644 --- a/src/core/iridescence.Rgb32Opaque.scala +++ b/src/core/iridescence.Rgb32Opaque.scala @@ -28,7 +28,8 @@ object Rgb32Opaque: given underlying: Underlying[Rgb32, Int] = ### given Rgb32 is Chromatic = _.srgb.rgb24.asInt - def apply(red: Int, green: Int, blue: Int): Rgb32 = ((red&1023) << 22) + ((green&4095) << 10) + (blue&1023) + def apply(red: Int, green: Int, blue: Int): Rgb32 = + ((red&1023) << 22) + ((green&4095) << 10) + (blue&1023) extension (color: Rgb32) def red: Int = (color >> 22)&1023 diff --git a/src/core/iridescence.RgbHex.scala b/src/core/iridescence.RgbHex.scala index eeae670..237c3b4 100644 --- a/src/core/iridescence.RgbHex.scala +++ b/src/core/iridescence.RgbHex.scala @@ -45,7 +45,8 @@ object RgbHex extends Interpolator[Nothing, Option[Rgb24], Rgb24]: rgb"rrggbb" where rr, gg and bb are 2-digit hex values""", 0) def insert(state: Option[Rgb24], value: Nothing): Option[Rgb24] = - throw InterpolationError(m"substitutions into an ${Text("rgb\"\"")} interpolator are not supported") + throw InterpolationError: + m"substitutions into an ${Text("rgb\"\"")} interpolator are not supported" def skip(state: Option[Rgb24]): Option[Rgb24] = state def complete(color: Option[Rgb24]): Rgb24 = color.get diff --git a/src/core/iridescence.colorProfiles.scala b/src/core/iridescence.colorProfiles.scala index c4e6dbc..2cdf723 100644 --- a/src/core/iridescence.colorProfiles.scala +++ b/src/core/iridescence.colorProfiles.scala @@ -20,7 +20,10 @@ import language.experimental.captureChecking object colorProfiles: given incandescentTungsten: ColorProfile = ColorProfile(109.850, 100, 35.585, 111.144, 100, 35.2) - given oldDirectSunlightAtNoon: ColorProfile = ColorProfile(99.0927, 100, 85.313, 99.178, 100, 84.3493) + + given oldDirectSunlightAtNoon: ColorProfile = + ColorProfile(99.0927, 100, 85.313, 99.178, 100, 84.3493) + given oldDaylight: ColorProfile = ColorProfile(98.074, 100, 118.232, 97.285, 100, 116.145) given iccProfilePcs: ColorProfile = ColorProfile(96.422, 100, 82.521, 96.720, 100, 81.427) given midMorningDaylight: ColorProfile = ColorProfile(95.682, 100, 92.149, 95.799, 100, 90.926) @@ -29,7 +32,10 @@ object colorProfiles: given adobeRgb: ColorProfile = daylight given northSkyDaylight: ColorProfile = ColorProfile(94.972, 100, 122.638, 94.416, 100, 120.641) given equalEnergy: ColorProfile = ColorProfile(100, 100, 100, 100, 100, 100) - given daylightFluorescentF1: ColorProfile = ColorProfile(92.834, 100, 103.665, 94.791, 100, 103.191) + + given daylightFluorescentF1: ColorProfile = + ColorProfile(92.834, 100, 103.665, 94.791, 100, 103.191) + given coolFluorescent: ColorProfile = ColorProfile(99.187, 100, 67.395, 103.280, 100, 69.026) given whiteFluorescent: ColorProfile = ColorProfile(103.754, 100, 49.861, 108.968, 100, 51.965) @@ -38,7 +44,10 @@ object colorProfiles: given daylightFluorescentF5: ColorProfile = ColorProfile(90.872, 100, 98.723, 93.369, 100, 98.636) given liteWhiteFluorescent: ColorProfile = ColorProfile(97.309, 100, 60.191, 102.148, 100, 62.074) - given daylightFluorescentF7: ColorProfile = ColorProfile(95.044, 100, 108.755, 95.792, 100, 107.687) + + given daylightFluorescentF7: ColorProfile = + ColorProfile(95.044, 100, 108.755, 95.792, 100, 107.687) + given d65Simulator: ColorProfile = daylightFluorescentF7 given sylvaniaF40: ColorProfile = ColorProfile(96.413, 100, 82.333, 97.115, 100, 81.135) given d50Simulator: ColorProfile = sylvaniaF40